DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
servoy sSummary12%30%58%height: 30px;3Constants SummaryConstant that is returned as a JSEvent type when in the callback method when it executed normally.
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);
}
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);
}
This client id can be used to find the client from the headless client plugin. Note that this client id is not the same id as the id displayed on the Aplicationb Server admin page.
Gets the id of the client.
This client id can be used to find the client from the headless client plugin.
Note that this client id is not the same id as the id displayed on the Aplicationb Server admin page.
if (jsclient && jsclient.isValid())
{
// only gets the globals.media when the 'remoteMethod' is currently executing for this client
var value = jsclient.getDataProviderValue(null, "scopes.globals.number", 'remoteMethod');
if (value != null)
{
application.output("value get from scopes.globals.number :: "+ value);
scopes.globals.value = value+10;
var returnValue = jsclient.setDataProviderValue(null, "scopes.globals.number", scopes.globals.value, 'remoteMethod');
application.output("value set to scopes.globals.number previous value "+ returnValue);
}
else
{
application.output("value get from scopes.globals.number :: " + null);
}
}
The context of the given method; null if it is global method or a form name for a form method.
...
dataprovider
...
the data-provider name as seen in Servoy.
...
methodName
...
if this is specified, the data-provider's value will only be returned if the specified method is running in this headless client because the currently running client requested it to. Otherwise undefined is returned.
...
ret
...
Returns
...
sIndentclients
...
class
sIndent
...
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
if (jsclient && jsclient.isValid())
{
// only gets the globals.media when the 'remoteMethod' is currently executing for this client
var value = jsclient.getDataProviderValue(null, "scopes.globals.number", 'remoteMethod');
if (value != null)
{
application.output("value get from scopes.globals.number :: "+ value);
scopes.globals.value = value+10;
var returnValue = jsclient.setDataProviderValue(null, "scopes.globals.number", scopes.globals.value, 'remoteMethod');
application.output("value set to scopes.globals.number previous value "+ returnValue);
}
else
{
application.output("value get from scopes.globals.number :: " + null);
}
}
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);
}
Table Row (tr)
class
lastDetailRow
Table Cell (td)
...
id
queueMethod-String_String_ObjectArray_Function
Table Row (tr)
id
name
Table Cell (td)
queueMethod
...
id
sig
...
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
queueMethod
...
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowisValidname
isValid()
dessIndent
returns true if this client is still valid/usable.
The context of the given method, null if it is global method or a form name for a form method.
...
methodName
...
The method name.
...
args
...
The arguments that should be passed to the method.
...
notifyCallBackMethod
...
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
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);
}
The context of the given method, null if it is global method or a form name for a form method.
...
dataprovider
...
the data-provider name as seen in Servoy.
...
value
...
the value to set.
...
ret
...
Returns
...
sIndentclients
...
class
sIndent
...
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
if (jsclient && jsclient.isValid())
{
// only gets the globals.media when the 'remoteMethod' is currently executing for this client
var value = jsclient.getDataProviderValue(null, "scopes.globals.number", 'remoteMethod');
if (value != null)
{
application.output("value get from scopes.globals.number :: "+ value);
scopes.globals.value = value+10;
var returnValue = jsclient.setDataProviderValue(null, "scopes.globals.number", scopes.globals.value, 'remoteMethod');
application.output("value set to scopes.globals.number previous value "+ returnValue);
}
else
{
application.output("value get from scopes.globals.number :: " + null);
}
}
The context of the given method, null if it is global method or a form name for a form method
...
dataprovider
...
the data-provider name as seen in Servoy
...
value
...
the value to set
...
methodName
...
if this is specified, the data-provider's value will only be set if the specified method is running in this headless client because the currently running client requested it to. Otherwise the value is not set into the data-provider and undefined is returned.
...
ret
...
Returns
...
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
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);
}
...
class
lastDetailRow
...
sIndentclients
...
class
sIndent
...
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
if (jsclient && jsclient.isValid())
{
// only gets the globals.media when the 'remoteMethod' is currently executing for this client
var value = jsclient.getDataProviderValue(null, "scopes.globals.number", 'remoteMethod');
if (value != null)
{
application.output("value get from scopes.globals.number :: "+ value);
scopes.globals.value = value+10;
var returnValue = jsclient.setDataProviderValue(null, "scopes.globals.number", scopes.globals.value, 'remoteMethod');
application.output("value set to scopes.globals.number previous value "+ returnValue);
}
else
{
application.output("value get from scopes.globals.number :: " + null);
}
}
Table Row (tr)
class
lastDetailRow
Table Cell (td)
Table Body (tbody)
id
shutdown
Table Row (tr)
id
name
Table Cell (td)
shutdown
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
void
Span
style
font-weight: bold;
shutdown
Span
()
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
closes the client.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
void
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
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);
}