Console API

ClientPal

List of Classes

ClientPal

Method Summary
void getChannel()

Returns the channel (function) for an inline pal to communicate with the parent pal on the client.

void getGeoLocation(NonTyped successFunction,NonTyped failFunction)

Calls the specified function(s) passing the result of navigator.geolocation HTML5 API. This is asynchronous.

void openTransaction(String encryptedId)

Opens Navigator with the specified transaction. The ID must be passed encrypted to this method.

void sendPageForm(String action,String params)

Submits the page to the server.

int getDocumentWidth()

Returns width of the DOM document.

int getHorizontalScroll()

Returns the position of the horizontal scrollbar.

String getPageFormName()

Returns the name of the page form.

void launchFileEditor(String fileId)

Launches the appropriate desktop editor for the given file.

int getVerticalScroll()

Returns the position of the vertical scrollbar.

void loadResource(String id, String resource, String source, String version)

Loads the specified resource into the page if it does not already exist

void sendRemoteAjaxRequest(String url, String handler, NonTyped params)

Posts an ajax request to a remote server. url and handler are required. params can be a querystring, a form object, or nothing (don's pass a param). The success of this call depends on the browser and its security settings. Your handler will receive three arguments: text of response, content type, and http status code.

void enableFullAjax(boolean enabled)

Enables or disables full AJAX support. Use cautiously.

Window openWindow(String url, String name, String params)

Creates, opens, and returns a handle to a window.

Form Object getPageForm()

Returns the page form object.

int getViewportHeight()

Return the height of the browser viewport area.

int getViewportWidth()

Return the width of the browser viewport area.

void delayExec(String scriptToExecute)

Runs the specified script after the library is loaded. See loadResource.

int getDocumentHeight()

Returns height of the DOM document.

void runJavascript(String js)

Executes the given javascript. Use this in place of eval.

void registerAjaxErrorHandler(NonTyped handler)

Registers a function to handle server error messages generated during ajax calls.

void sendAjaxRequest(String action, NonTyped handler, NonTyped params, NonTyped json, String workflow)

Posts an ajax request. action and handler are required. handler can be a function name (string) or an actual function. params can be a querystring, a form object, or nothing (don's pass a param).

int getWindowX()

Return the X position of the window on the screen.

int getWindowY()

Return the Y position of the window on the screen.

Method Detail


void getChannel()

Returns the channel (function) for an inline pal to communicate with the parent pal on the client.

Since: 07-23-2019

top

void getGeoLocation(NonTyped successFunction,NonTyped failFunction)

Calls the specified function(s) passing the result of navigator.geolocation HTML5 API. This is asynchronous.

Parameters:

  • NonTyped successFunction
  • NonTyped failFunction

Since: 12-14-2016

top

void openTransaction(String encryptedId)

Opens Navigator with the specified transaction. The ID must be passed encrypted to this method.

Parameters:

  • String encryptedId

Since: 01-19-2010

top

void sendPageForm(String action,String params)

Submits the page to the server.

Parameters:

  • String action
  • String params

Since: 11-20-09

top

int getDocumentWidth()

Returns width of the DOM document.

Returns:  int

Since: 11-07-08

top

int getHorizontalScroll()

Returns the position of the horizontal scrollbar.

Returns:  int

Since: 11-07-08

top

String getPageFormName()

Returns the name of the page form.

Returns:  String

Since: 09-27-08

top

void launchFileEditor(String fileId)

Launches the appropriate desktop editor for the given file.

Parameters:

  • String fileId

Since: 10-25-2010

top

int getVerticalScroll()

Returns the position of the vertical scrollbar.

Returns:  int

Since: 11-07-08

top

void loadResource(String id, String resource, String source, String version)

Loads the specified resource into the page if it does not already exist

Parameters:

  • String id
  • String resource
  • String source
  • String version

Since: 06-20-2019

Sample:

// load current version of bootstrap-min.css from platform
ClientPal.loadResource("bs","bootstrap-min.css","bootstrap");

// load specified version of bootstrap-min.css from platform
ClientPal.loadResource("bs","bootstrap-min.css","bootstrap","3.3.7");

// load bootstrap-min.css from the pal
ClientPal.loadResource("bs","bootstrap-min.css");

//load myStuff.js, a custom script, from the pal
ClientPal.loadResource("myStuff","myStuff.js");

ClientPal.delayExec("showSomethingThatDependsOnResourceLoaded()");
top

void sendRemoteAjaxRequest(String url, String handler, NonTyped params)

Posts an ajax request to a remote server. url and handler are required. params can be a querystring, a form object, or nothing (don's pass a param). The success of this call depends on the browser and its security settings. Your handler will receive three arguments: text of response, content type, and http status code.

Parameters:

  • String url
  • String handler
  • NonTyped params

Since: 04-15-2017

Sample:

// Note- as of 12/3/2009 this feature only works with IE in the trusted sites zone with low security
// Future support might include Firefox 3.5 and other browsers supporting resource sharing
// See "http://www.w3.org/TR/access-control/
// client-side javascript
function sendAjax()
{
    ClientPal.sendRemoteAjaxRequest("https://yoursite.com/yourhandler.php","resultHandler",ClientPal.getPageForm());
}


function resultHandler(result,contentType,statusCode)
{
    if (result!=null)
    {
        // or var obj = JSON.parse(result);
        document.getElementById("result").innerHTML=html;
    }
}

top

void enableFullAjax(boolean enabled)

Enables or disables full AJAX support. Use cautiously.

Parameters:

  • boolean enabled

Since: 06-23-2011

top

Window openWindow(String url, String name, String params)

Creates, opens, and returns a handle to a window.

Parameters:

  • String url
  • String name
  • String params

Returns:  Window

Since: 11-07-08

Sample:

function openThisWindow()
{
    var url = "http://www.someothersite.com";
    var name="myWIndow";
    var params="toolbar=yes,width=300,height=300,resizable=yes,scrollbars=yes,location=yes,status=yes,directories=yes,menubar=yes,copyhistory=no";
    var win = ClientPal.openWindow(url,name,params);
}
top

Form Object getPageForm()

Returns the page form object.

Returns:  Form Object

Since: 09-27-08

top

int getViewportHeight()

Return the height of the browser viewport area.

Returns:  int

Since: 11-07-08

top

int getViewportWidth()

Return the width of the browser viewport area.

Returns:  int

Since: 11-07-08

top

void delayExec(String scriptToExecute)

Runs the specified script after the library is loaded. See loadResource.

Parameters:

  • String scriptToExecute

Since: 06-20-2019

Sample:

// load current version of bootstrap-min.css from platform
ClientPal.loadResource("bs","bootstrap-min.css","bootstrap");

// load specified version of bootstrap-min.css from platform
ClientPal.loadResource("bs","bootstrap-min.css","bootstrap","3.3.7");

// load bootstrap-min.css from the pal
ClientPal.loadResource("bs","bootstrap-min.css");

//load myStuff.js, a custom script, from the pal
ClientPal.loadResource("myStuff","myStuff.js");

ClientPal.delayExec("showSomethingThatDependsOnResourceLoaded()");
top

int getDocumentHeight()

Returns height of the DOM document.

Returns:  int

Since: 11-07-08

top

void runJavascript(String js)

Executes the given javascript. Use this in place of eval.

Parameters:

  • String js

Since: 09-27-08

Sample:

var x = 3;
ClientPal.runJavascript("a=x*9");
top

void registerAjaxErrorHandler(NonTyped handler)

Registers a function to handle server error messages generated during ajax calls.

Parameters:

  • NonTyped handler

Since: 05-23-2012

top

void sendAjaxRequest(String action, NonTyped handler, NonTyped params, NonTyped json, String workflow)

Posts an ajax request. action and handler are required. handler can be a function name (string) or an actual function. params can be a querystring, a form object, or nothing (don's pass a param).

Parameters:

  • String action
  • NonTyped handler
  • NonTyped params
  • NonTyped json
  • String workflow

Since: 09-27-08

Sample:

// client-side javascript
function sendAjax()
{
    ClientPal.sendAjaxRequest("saveThis","resultHandler",ClientPal.getPageForm());
    // alternately ClientPal.sendAjaxRequest("saveThis","resultHandler","choice=1&item=2");
}

function resultHandler(html,js)
{
    if (html!=null)
    {
        document.getElementById("result").innerHTML=html;
    }
    if (js!=null)
    {
        ClientPal.runJavascript(js);
    }
}

// server-side workflow
if (c.isAction("saveThis"))
{
    var frag = c.createFragment("frag","<p>OK</p>",false);
    var response = c.createAjaxResponse(frag,false);
    response.addJavascript("alert('we saved your info')");
    return response;
}
top

int getWindowX()

Return the X position of the window on the screen.

Returns:  int

Since: 11-07-08

top

int getWindowY()

Return the Y position of the window on the screen.

Returns:  int

Since: 11-07-08

top
Copyright © 2006 - 2026, ContractPal, Inc. All rights reserved. API Date: Apr 11, 2026 06:50 PM