Child pages
  • JSClient

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
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


HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Constants Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#CALLBACK_EVENT
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#CALLBACK_EXCEPTION_EVENT

HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getClientID()
gets the id of the client
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
#getDataProviderValue(context, variableName, [currentMethodName])
get a dataprovider value from the client
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#isValid()
returns true if this client is still valid/usable
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#queueMethod(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
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
#setDataProviderValue(context, variableName, value, [currentMethodName])
set a dataprovider value on the client
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#shutdown(force)
shutdown

HTML Table
idconstant
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Constants Details
Table Body (tbody)
idCALLBACK_EVENT
classnode
Table Row (tr)
idname
Table Cell (td)
CALLBACK_EVENT
Table Row (tr)
iddes
Table Cell (td)
Replace with description
Table Row (tr)
idret
Table Cell (td)
Returns
String
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idCALLBACK_EXCEPTION_EVENT
classnode
Table Row (tr)
idname
Table Cell (td)
CALLBACK_EXCEPTION_EVENT
Table Row (tr)
iddes
Table Cell (td)
Replace with description
Table Row (tr)
idret
Table Cell (td)
Returns
String
Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idgetClientID
classnode
Table Row (tr)
idname
Table Cell (td)
getClientID
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
getClientID
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
gets the id of the client
Table Row (tr)
idret
Table Cell (td)
Returns
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataProviderValue
classnode
Table Row (tr)
idname
Table Cell (td)
getDataProviderValue
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Object
Span
stylefloat: left; font-weight: bold;
idiets
getDataProviderValue
Span
stylefloat: left;
idiets
(context, variableName, [currentMethodName])
Table Row (tr)
iddes
Table Cell (td)
get a dataprovider value from the client
Table Row (tr)
idprs
Table Cell (td)
Parameters
context
variableName
[currentMethodName]
Table Row (tr)
idret
Table Cell (td)
Returns
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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);
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idisValid
classnode
Table Row (tr)
idname
Table Cell (td)
isValid
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
isValid
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
returns true if this client is still valid/usable
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idqueueMethod
classnode
Table Row (tr)
idname
Table Cell (td)
queueMethod
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
queueMethod
Span
stylefloat: left;
idiets
(context, methodName, args, callbackFunction)
Table Row (tr)
iddes
Table Cell (td)
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
Table Row (tr)
idprs
Table Cell (td)
Parameters
context
methodName
args
callbackFunction
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetDataProviderValue
classnode
Table Row (tr)
idname
Table Cell (td)
setDataProviderValue
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Object
Span
stylefloat: left; font-weight: bold;
idiets
setDataProviderValue
Span
stylefloat: left;
idiets
(context, variableName, value, [currentMethodName])
Table Row (tr)
iddes
Table Cell (td)
set a dataprovider value on the client
Table Row (tr)
idprs
Table Cell (td)
Parameters
context
variableName
value
[currentMethodName]
Table Row (tr)
idret
Table Cell (td)
Returns
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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);
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idshutdown
classnode
Table Row (tr)
idname
Table Cell (td)
shutdown
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
shutdown
Span
stylefloat: left;
idiets
(force)
Table Row (tr)
iddes
Table Cell (td)
shutdown
Table Row (tr)
idprs
Table Cell (td)
Parameters
force
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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)
classlastDetailRow
Table Cell (td)