Child pages
  • JSMethod

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table Cell (td)
String

...

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.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
Divcache
styleindexdisplay:none

...

iddescription

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClient

servoy sSummary12%30%58%height: 30px;3Property SummaryThe full source code of this method (including doc and function declaration).

...

Table Cell (td)
Boolean

...

...

padding0px
width80px

...

Flag that tells if the method appears or not in the "Methods" menu of Servoy Client.

...

servoy sSummary12%30%58%height: 30px;

...

Table Head (th)
colspan2
Method Summary

...

Table Cell (td)
Object[]

...

3Methods SummaryGets the argument array for this method if that is set for the specific action this method is taken from.

...

Table Cell (td)
String

...

The name of the method.

...

Table Cell (td)
String

...

Get scope name

...

Table Cell (td)
UUID

...

Returns the UUID of the method object

...

property

...

servoy sDetail

...

padding0px
width100%

...

2100%height:30px

...

colspan1

...

2Property Details

...

code

...

name

...

code

...

...

des

...

sIndent
The full source code of this method (including doc and function declaration).

...

ret

...

Returns

...

classlastDetailRow

...

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idgetArguments
Table Row (tr)
idname
Table Cell (td)
getArguments
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object[]
Span
stylefont-weight: bold;
getArguments
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the argument array for this method if that is set for the specific action this method is taken from.
Will return null by default. This is only for reading, you can't alter the arguments through this array,
for that you need to create a new object through solutionModel.wrapMethodWithArguments(..) and assign it again.
Table Row (tr)
idret
Table Cell (td)Returns
Div
classsIndent
Object[] –

sIndentclients

...

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var method = form.newMethod('function original() { application.output("Original function."); }');
application.output('original method name: ' + method.getName());
application.output('original method code: ' + method.code);
method.code = 'function changed() { application.output("This is another function."); }';
method.showInMenu = false;
var button = form.newButton('Click me!', 10, 10, 100, 30, method);

...

classlastDetailRow

...

idshowInMenu
Table Row (tr)
idname
Table Cell (td)
showInMenu
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Flag that tells if the method appears or not in the "Methods" menu of Servoy Client.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var method = form.newMethod('function original() { application.output("Original function."); }');
application.output('original method name: ' + method.getName());
application.output('original method code: ' + method.code);
method.code = 'function changed() { application.output("This is another function."); }';
method.showInMenu = false;
var button = form.newButton('Click me!', 10, 10, 100, 30, method);
functionservoy sDetail2100%height:30px2Methods DetailsgetArgumentsname

getArguments()

dessIndent
Gets the argument array for this method if that is set for the specific action this method is taken from.
Will return null by default. This is only for reading, you can't alter the arguments through this array,
for that you need to create a new object through solutionModel.wrapMethodWithArguments(..) and assign it again.
ret

Returns

sIndent Array of the arguments, null if not specified.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Returns
String

Sample

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
showInMenuname

showInMenu

dessIndent
Flag that tells if the method appears or not in the "Methods" menu of Servoy Client.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

id
Table Row (tr)
Table Cell (td)
Table Row (tr)
idret
Table Cell (td)
Div
classsIndent
Div
classsIndent
Code Block
languagejavascript

var frm = solutionModel.getForm("myForm");
var button = frm.getButton("button");
// get the arguments from the button.
// NOTE: string arguments will be returned with quotes (comp.onAction.getArguments()[0] == '\'foo\' evals to true)
var arguments = button.onAction.getArguments();
if (arguments && arguments.length > 1 && arguments[1] == 10) { 
	// change the value and assign it back to the onAction.
	arguments[1] = 50;
	button.onAction = solutionModel.wrapMethodWithArguments(button.onAction,arguments);
}
Table Row (tr)
classlastDetailRow
Table Cell (td) Table Body (tbody)
idgetName
Table Row (tr)
idname
Table Cell (td)
getName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
The name of the method.
sIdentjavascriptlastDetailRowgetNamename

getName()

dessIndent
The name of the method.
ret

Returns

sIndent A String holding the name of this method.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var method = form.newMethod('function original() { application.output("Original function."); }');
application.output('original method name: ' + method.getName());
application.output('original method code: ' + method.code);
method.code = 'function changed() { application.output("This is another function."); }';
method.showInMenu = false;
var button = form.newButton('Click me!', 10, 10, 100, 30, method);
Table Row (tr)
classlastDetailRow
Table Cell (td) Table Body (tbody)
idgetScopeName
Table Row (tr)
idname
Table Cell (td)
getScopeName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getScopeName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get scope name
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var methods = solutionModel.getGlobalMethods(); 
for (var x in methods) 
	application.output(methods[x].getName() + ' is defined in scope ' + methods[x].getScopeName());
Table Row (tr)
classlastDetailRow
Table Cell (td) Table Body (tbody)
idgetUUID
Table Row (tr)
idname
Table Cell (td)
getUUID
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
UUID
Span
stylefont-weight: bold;
getUUID
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the UUID of the method object
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
UUID
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var method = form.newMethod('function original() { application.output("Original function."); }');
application.output(method.getUUID().toString());
Table Row (tr)
classlastDetailRow
tdclients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
getScopeNamename

getScopeName()

dessIndent
Get scope name
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
getUUIDname

getUUID()

dessIndent
Returns the UUID of the method object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow