gets the id of the client |
|
Sample
if (jsclient && jsclient.isValid())
{
/*Queue a method where the callback can do something like this
if (event.getType() == JSClient.CALLBACK_EVENT)
{
application.output("callback data, name: " + event.data);
}
else if (event.getType() == JSClient.CALLBACK_EXCEPTION_EVENT)
{
application.output("exception callback, name: " + event.data);
}*/
var x = new Object();
x.name = 'remote1';
x.number = 10;
// this calls a 'remoteMethod' on the server as a global method, because the context (first argument is set to null), you can use a formname to call a form method
jsclient.queueMethod(null, "remoteMethod", [x], callback);
}
|
|
|
|
|
(context, variableName, [currentMethodName]) |
|
|
get a dataprovider value from the client |
|
Parameters context
variableName
[currentMethodName] |
|
Sample
if (jsclient && jsclient.isValid())
{
// only gets the globals.media when the 'remoteMethod' is currently executing for this client
var value = jsclient.getDataProviderValue(null, "globals.number", 'remoteMethod');
if (value != null)
{
application.output("value get from globals.number :: "+ value);
globals.value = value+10;
var returnValue = jsclient.setDataProviderValue(null, "globals.number", globals.value, 'remoteMethod');
application.output("value set to globals.number previous value "+ returnValue);
}
else
{
application.output("value get from globals.number :: " + null);
}
}
|
|
|
|
|
returns true if this client is still valid/usable |
|
Sample
if (jsclient && jsclient.isValid())
{
/*Queue a method where the callback can do something like this
if (event.getType() == JSClient.CALLBACK_EVENT)
{
application.output("callback data, name: " + event.data);
}
else if (event.getType() == JSClient.CALLBACK_EXCEPTION_EVENT)
{
application.output("exception callback, name: " + event.data);
}*/
var x = new Object();
x.name = 'remote1';
x.number = 10;
// this calls a 'remoteMethod' on the server as a global method, because the context (first argument is set to null), you can use a formname to call a form method
jsclient.queueMethod(null, "remoteMethod", [x], callback);
}
|
|
|
|
|
(context, methodName, args, callbackFunction) |
|
|
queue a method on the client, calling the method name specified on the context, the callback method will get a JSEvent as the first and a JSClient (the this of the client that did the call) as the second parameter |
|
Parameters context
methodName
args
callbackFunction |
|
Sample
if (jsclient && jsclient.isValid())
{
/*Queue a method where the callback can do something like this
if (event.getType() == JSClient.CALLBACK_EVENT)
{
application.output("callback data, name: " + event.data);
}
else if (event.getType() == JSClient.CALLBACK_EXCEPTION_EVENT)
{
application.output("exception callback, name: " + event.data);
}*/
var x = new Object();
x.name = 'remote1';
x.number = 10;
// this calls a 'remoteMethod' on the server as a global method, because the context (first argument is set to null), you can use a formname to call a form method
jsclient.queueMethod(null, "remoteMethod", [x], callback);
}
|
|
|
|
|
(context, variableName, value, [currentMethodName]) |
|
|
set a dataprovider value on the client |
|
Parameters context
variableName
value
[currentMethodName] |
|
Sample
if (jsclient && jsclient.isValid())
{
// only gets the globals.media when the 'remoteMethod' is currently executing for this client
var value = jsclient.getDataProviderValue(null, "globals.number", 'remoteMethod');
if (value != null)
{
application.output("value get from globals.number :: "+ value);
globals.value = value+10;
var returnValue = jsclient.setDataProviderValue(null, "globals.number", globals.value, 'remoteMethod');
application.output("value set to globals.number previous value "+ returnValue);
}
else
{
application.output("value get from globals.number :: " + null);
}
}
|
|
|
|
|
Sample
if (jsclient && jsclient.isValid())
{
/*Queue a method where the callback can do something like this
if (event.getType() == JSClient.CALLBACK_EVENT)
{
application.output("callback data, name: " + event.data);
}
else if (event.getType() == JSClient.CALLBACK_EXCEPTION_EVENT)
{
application.output("exception callback, name: " + event.data);
}*/
var x = new Object();
x.name = 'remote1';
x.number = 10;
// this calls a 'remoteMethod' on the server as a global method, because the context (first argument is set to null), you can use a formname to call a form method
jsclient.queueMethod(null, "remoteMethod", [x], callback);
}
|
|
|
|
|
|