{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\
{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#CALLBACK_EVENT]
Constant that is returned as a JSEvent type when in the callback method when it executed normally.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#CALLBACK_EXCEPTION_EVENT]
Cache
index
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Constants SummaryConstant that is returned as a JSEvent type when in the callback method when it executed normally.Constant that is returned as a JSEvent type when in the callback method when an exception occurred.servoy sSummary12%30%58%height: 30px;3Methods SummaryGets the id of the client.Get a data-provider value.Get a data-provider value.returns true if this client is still valid/usable.voidQueues a method call on the remote server, without a callback method.voidQueues a method call on the remote server.Set a data-provider value.Set a data-provider value.voidcloses the client.voidcloses the client.constantservoy sDetail2100%height:30px2Constants DetailsCALLBACK_EVENTname
CALLBACK_EVENT
dessIndent
Constant that is returned as a JSEvent type when in the callback method when
an
it
exception
executed
occurred.{td}{tr}{tbody}{table}\\
{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#getClientID]\()
Gets the id of the client.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#getDataProviderValue]\(contextName, dataprovider)
Get a data\-provider value.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#getDataProviderValue]\(contextName, dataprovider, methodName)
Get a data\-provider value.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isValid]\()
returns true if this client is still valid/usable.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#queueMethod]\(contextName, methodName, args, notifyCallBackMethod)
Queues a method call on the remote server.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#setDataProviderValue]\(contextName, dataprovider, value)
Set a data\-provider value.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#setDataProviderValue]\(contextName, dataprovider, value, methodName)
Set a data\-provider value.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#shutdown]\()
closes the client.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#shutdown]\(force)
closes the client.{td}{tr}{tbody}{table}\\
{table:id=constant|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=CALLBACK_EVENT|class=node}{tr:id=name}{td}h6.CALLBACK_EVENT{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:CALLBACK_EVENT_des|trigger=button|text=}{sub-section}{sub-section:CALLBACK_EVENT_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:CALLBACK_EVENT_snc|trigger=button|text=}{sub-section}{sub-section:CALLBACK_EVENT_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:CALLBACK_EVENT_prs|trigger=button|text=}{sub-section}{sub-section:CALLBACK_EVENT_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:CALLBACK_EVENT_ret|trigger=button|text=}{sub-section}{sub-section:CALLBACK_EVENT_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CALLBACK_EVENT_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:CALLBACK_EVENT_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CALLBACK_EVENT_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:CALLBACK_EVENT_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CALLBACK_EVENT_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:CALLBACK_EVENT_sam|trigger=none}{code: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);
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CALLBACK_EXCEPTION_EVENT|class=node}{tr:id=name}{td}h6.CALLBACK_EXCEPTION_EVENT{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:CALLBACK_EXCEPTION_EVENT_des|trigger=button|text=}{sub-section}{sub-section:CALLBACK_EXCEPTION_EVENT_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:CALLBACK_EXCEPTION_EVENT_snc|trigger=button|text=}{sub-section}{sub-section:CALLBACK_EXCEPTION_EVENT_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:CALLBACK_EXCEPTION_EVENT_prs|trigger=button|text=}{sub-section}{sub-section:CALLBACK_EXCEPTION_EVENT_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:CALLBACK_EXCEPTION_EVENT_ret|trigger=button|text=}{sub-section}{sub-section:CALLBACK_EXCEPTION_EVENT_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CALLBACK_EXCEPTION_EVENT_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:CALLBACK_EXCEPTION_EVENT_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CALLBACK_EXCEPTION_EVENT_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:CALLBACK_EXCEPTION_EVENT_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CALLBACK_EXCEPTION_EVENT_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:CALLBACK_EXCEPTION_EVENT_sam|trigger=none}{code: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);
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\
{table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getClientID|class=node}{tr:id=name}{td}h6.getClientID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getClientID{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getClientID_des|trigger=button|text=}{sub-section}{sub-section:getClientID_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getClientID_snc|trigger=button|text=}{sub-section}{sub-section:getClientID_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getClientID_prs|trigger=button|text=}{sub-section}{sub-section:getClientID_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getClientID_ret|trigger=button|text=}{sub-section}{sub-section:getClientID_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getClientID_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getClientID_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getClientID_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getClientID_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getClientID_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getClientID_sam|trigger=none}{code:language=javascript}
var headlessClient = plugins.headlessclient.createClient("someSolution", "user", "pass", null);
var clientID = headlessClient.getClientID()
....
headlessClient = plugins.headlessclient.getClient(clientID);
if (headlessClient != null && headlessClient.isValid()) {
headlessClient.queueMethod(null, "someRemoteMethod", null, callback);
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDataProviderValue-String_String|class=node}{tr:id=name}{td}h6.getDataProviderValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}getDataProviderValue{span}{span:id=iets|style=float: left;}\(contextName, dataprovider){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getDataProviderValue-String_String_des|trigger=button|text=}{sub-section}{sub-section:getDataProviderValue-String_String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getDataProviderValue-String_String_snc|trigger=button|text=}{sub-section}{sub-section:getDataProviderValue-String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getDataProviderValue-String_String_prs|trigger=button|text=}{sub-section}{sub-section:getDataProviderValue-String_String_prs|trigger=none|class=sIndent}\{[String]} contextName -- The context of the given method, null if it is global method or a form name for a form method
\{[String]} dataprovider -- the data\-provider name as seen in Servoy
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getDataProviderValue-String_String_ret|trigger=button|text=}{sub-section}{sub-section:getDataProviderValue-String_String_ret|trigger=none|class=sIndent}[Object] -- the value for the data-provider.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getDataProviderValue-String_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getDataProviderValue-String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getDataProviderValue-String_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getDataProviderValue-String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getDataProviderValue-String_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getDataProviderValue-String_String_sam|trigger=none}{code: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);
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDataProviderValue-String_String_String|class=node}{tr:id=name}{td}h6.getDataProviderValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}getDataProviderValue{span}{span:id=iets|style=float: left;}\(contextName, dataprovider, methodName){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getDataProviderValue-String_String_String_des|trigger=button|text=}{sub-section}{sub-section:getDataProviderValue-String_String_String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getDataProviderValue-String_String_String_snc|trigger=button|text=}{sub-section}{sub-section:getDataProviderValue-String_String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getDataProviderValue-String_String_String_prs|trigger=button|text=}{sub-section}{sub-section:getDataProviderValue-String_String_String_prs|trigger=none|class=sIndent}\{[String]} contextName -- The context of the given method; null if it is global method or a form name for a form method.
\{[String]} dataprovider -- the data\-provider name as seen in Servoy.
\{[String]} 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.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getDataProviderValue-String_String_String_ret|trigger=button|text=}{sub-section}{sub-section:getDataProviderValue-String_String_String_ret|trigger=none|class=sIndent}[Object] -- the value of the data-provider.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getDataProviderValue-String_String_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getDataProviderValue-String_String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getDataProviderValue-String_String_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getDataProviderValue-String_String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getDataProviderValue-String_String_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getDataProviderValue-String_String_String_sam|trigger=none}{code: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);
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isValid|class=node}{tr:id=name}{td}h6.isValid{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isValid{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:isValid_des|trigger=button|text=}{sub-section}{sub-section:isValid_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:isValid_snc|trigger=button|text=}{sub-section}{sub-section:isValid_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:isValid_prs|trigger=button|text=}{sub-section}{sub-section:isValid_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:isValid_ret|trigger=button|text=}{sub-section}{sub-section:isValid_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:isValid_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:isValid_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:isValid_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:isValid_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:isValid_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:isValid_sam|trigger=none}{code: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);
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=queueMethod-String_String_ObjectArray_Function|class=node}{tr:id=name}{td}h6.queueMethod{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}queueMethod{span}{span:id=iets|style=float: left;}\(contextName, methodName, args, notifyCallBackMethod){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:queueMethod-String_String_ObjectArray_Function_des|trigger=button|text=}{sub-section}{sub-section:queueMethod-String_String_ObjectArray_Function_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:queueMethod-String_String_ObjectArray_Function_snc|trigger=button|text=}{sub-section}{sub-section:queueMethod-String_String_ObjectArray_Function_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:queueMethod-String_String_ObjectArray_Function_prs|trigger=button|text=}{sub-section}{sub-section:queueMethod-String_String_ObjectArray_Function_prs|trigger=none|class=sIndent}\{[String]} contextName -- The context of the given method, null if it is global method or a form name for a form method.
\{[String]} methodName -- The method name.
\{[Object]\[]} args -- The arguments that should be passed to the method.
\{[Function]} notifyCallBackMethod -- The callback method that is called when the execution is finished.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:queueMethod-String_String_ObjectArray_Function_ret|trigger=button|text=}{sub-section}{sub-section:queueMethod-String_String_ObjectArray_Function_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:queueMethod-String_String_ObjectArray_Function_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:queueMethod-String_String_ObjectArray_Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:queueMethod-String_String_ObjectArray_Function_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:queueMethod-String_String_ObjectArray_Function_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:queueMethod-String_String_ObjectArray_Function_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:queueMethod-String_String_ObjectArray_Function_sam|trigger=none}{code: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);
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setDataProviderValue-String_String_Object|class=node}{tr:id=name}{td}h6.setDataProviderValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}setDataProviderValue{span}{span:id=iets|style=float: left;}\(contextName, dataprovider, value){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:setDataProviderValue-String_String_Object_des|trigger=button|text=}{sub-section}{sub-section:setDataProviderValue-String_String_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setDataProviderValue-String_String_Object_snc|trigger=button|text=}{sub-section}{sub-section:setDataProviderValue-String_String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setDataProviderValue-String_String_Object_prs|trigger=button|text=}{sub-section}{sub-section:setDataProviderValue-String_String_Object_prs|trigger=none|class=sIndent}\{[String]} contextName -- The context of the given method, null if it is global method or a form name for a form method.
\{[String]} dataprovider -- the data\-provider name as seen in Servoy.
\{[Object]} value -- the value to set.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setDataProviderValue-String_String_Object_ret|trigger=button|text=}{sub-section}{sub-section:setDataProviderValue-String_String_Object_ret|trigger=none|class=sIndent}[Object] -- the old value or null if no change.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setDataProviderValue-String_String_Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setDataProviderValue-String_String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setDataProviderValue-String_String_Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setDataProviderValue-String_String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setDataProviderValue-String_String_Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setDataProviderValue-String_String_Object_sam|trigger=none}{code: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);
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setDataProviderValue-String_String_Object_String|class=node}{tr:id=name}{td}h6.setDataProviderValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}setDataProviderValue{span}{span:id=iets|style=float: left;}\(contextName, dataprovider, value, methodName){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:setDataProviderValue-String_String_Object_String_des|trigger=button|text=}{sub-section}{sub-section:setDataProviderValue-String_String_Object_String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setDataProviderValue-String_String_Object_String_snc|trigger=button|text=}{sub-section}{sub-section:setDataProviderValue-String_String_Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setDataProviderValue-String_String_Object_String_prs|trigger=button|text=}{sub-section}{sub-section:setDataProviderValue-String_String_Object_String_prs|trigger=none|class=sIndent}\{[String]} contextName -- The context of the given method, null if it is global method or a form name for a form method
\{[String]} dataprovider -- the data\-provider name as seen in Servoy
\{[Object]} value -- the value to set
\{[String]} 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.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setDataProviderValue-String_String_Object_String_ret|trigger=button|text=}{sub-section}{sub-section:setDataProviderValue-String_String_Object_String_ret|trigger=none|class=sIndent}[Object] -- the old value or null if no change{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setDataProviderValue-String_String_Object_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setDataProviderValue-String_String_Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setDataProviderValue-String_String_Object_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setDataProviderValue-String_String_Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setDataProviderValue-String_String_Object_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:setDataProviderValue-String_String_Object_String_sam|trigger=none}{code: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);
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=shutdown|class=node}{tr:id=name}{td}h6.shutdown{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}shutdown{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:shutdown_des|trigger=button|text=}{sub-section}{sub-section:shutdown_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:shutdown_snc|trigger=button|text=}{sub-section}{sub-section:shutdown_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:shutdown_prs|trigger=button|text=}{sub-section}{sub-section:shutdown_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:shutdown_ret|trigger=button|text=}{sub-section}{sub-section:shutdown_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:shutdown_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutdown_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:shutdown_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutdown_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:shutdown_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutdown_sam|trigger=none}{code: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);
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=shutdown-Boolean|class=node}{tr:id=name}{td}h6.shutdown{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}shutdown{span}{span:id=iets|style=float: left;}\(force){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:shutdown-Boolean_des|trigger=button|text=}{sub-section}{sub-section:shutdown-Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:shutdown-Boolean_snc|trigger=button|text=}{sub-section}{sub-section:shutdown-Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:shutdown-Boolean_prs|trigger=button|text=}{sub-section}{sub-section:shutdown-Boolean_prs|trigger=none|class=sIndent}\{[Boolean]} force
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:shutdown-Boolean_ret|trigger=button|text=}{sub-section}{sub-section:shutdown-Boolean_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:shutdown-Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutdown-Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:shutdown-Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutdown-Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:shutdown-Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:shutdown-Boolean_sam|trigger=none}{code: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);
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
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.
sIndentcontextNameThe context of the given method, null if it is global method or a form name for a form methoddataproviderthe data-provider name as seen in Servoyret
sIndentcontextNameThe context of the given method; null if it is global method or a form name for a form method.dataproviderthe data-provider name as seen in Servoy.methodNameif 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
sIndent the value of the data-provider.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowisValidname
isValid()
dessIndent
returns true if this client is still valid/usable.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowqueueMethodname
queueMethod(contextName, methodName, args)
dessIndent
Queues a method call on the remote server, without a callback method.
Please note that calling queueMethod without a callback does not return anything: no result of the remote method or no exception if something went wrong.
prs
Parameters
sIndentcontextNameThe context of the given method, null if it is global method or a form name for a form method.methodNameThe method name.argsThe arguments that should be passed to the method.clients
Queues a method call on the remote server. The callback method will be called when the method is executed on the server
and the return value is given as the JSEvent.data object with the JSEvent.getType() value of JSClient.CALLBACK_EVENT.
If an exception is thrown somewhere then the callback method will be called with
the exception as the JSEvent data object with the JSEvent.getType() value of JSClient.CALLBACK_EXCEPTION_EVENT
The second argument that is give back is the JSClient instance that did the call.
prs
Parameters
sIndentcontextNameThe context of the given method, null if it is global method or a form name for a form method.methodNameThe method name.argsThe arguments that should be passed to the method.notifyCallBackMethodThe callback method that is called when the execution is finished.clients
sIndentcontextNameThe context of the given method, null if it is global method or a form name for a form method.dataproviderthe data-provider name as seen in Servoy.valuethe value to set.ret
Returns
sIndent the old value or null if no change.clients
sIndentcontextNameThe context of the given method, null if it is global method or a form name for a form methoddataproviderthe data-provider name as seen in Servoyvaluethe value to setmethodNameif 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