Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Constants Details |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Constant to be used when the type of a variable needs to be specified. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var dateVar = solutionModel.newGlobalVariable('globals', 'gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(scopes.globals.gDate); // Prints the current date and time. |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Constant to be used when the type of a variable needs to be specified. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var intVar = solutionModel.newGlobalVariable('globals', 'gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(scopes.globals.gInt); // Prints 997 |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Constant to be used when the type of a variable needs to be specified. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var mediaVar = solutionModel.newGlobalVariable('globals', ' |
|
|
|
| gDateDATETIMEdateVarmediaVar.defaultValue = ' |
|
|
|
| nownew Array(1, 2, 3, 4)';
application.output(scopes.globals. |
|
|
|
| gDategMedia); // Prints out the |
|
|
|
| currentdateandtime.
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=INTEGER|class=node}{tr:id=name}{td}h6.INTEGER{td}{tr}{tr:id=des}{td}{sub-section:INTEGER_des|trigger=button|text=}{sub-section}{sub-section:INTEGER_des|trigger=none|class=sIndent}Constant to be used when the type of a variable needs to be specified.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:INTEGER_snc|trigger=button|text=}{sub-section}{sub-section:INTEGER_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:INTEGER_prs|trigger=button|text=}{sub-section}{sub-section:INTEGER_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:INTEGER_ret|trigger=button|text=}{sub-section}{sub-section:INTEGER_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:INTEGER_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:INTEGER_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:INTEGER_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:INTEGER_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:INTEGER_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:INTEGER_sam|trigger=none}{code:language=javascript}
var intVar = solutionModel.newGlobalVariable('globals', 'gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(scopes.globals.gInt); // Prints 997
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=MEDIA|class=node}{tr:id=name}{td}h6.MEDIA{td}{tr}{tr:id=des}{td}{sub-section:MEDIA_des|trigger=button|text=}{sub-section}{sub-section:MEDIA_des|trigger=none|class=sIndent}Constant to be used when the type of a variable needs to be specified.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:MEDIA_snc|trigger=button|text=}{sub-section}{sub-section:MEDIA_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:MEDIA_prs|trigger=button|text=}{sub-section}{sub-section:MEDIA_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:MEDIA_ret|trigger=button|text=}{sub-section}{sub-section:MEDIA_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:MEDIA_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:MEDIA_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:MEDIA_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:MEDIA_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:MEDIA_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:MEDIA_sam|trigger=none}{code:language=javascript}
var mediaVar = solutionModel.newGlobalVariable('globals', 'gMedia', JSVariable.MEDIA);
mediaVar.defaultValue = 'new Array(1, 2, 3, 4)';
application.output(scopes.globals.gMedia); // Prints out the array with four elements.
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=NUMBER|class=node}{tr:id=name}{td}h6.NUMBER{td}{tr}{tr:id=des}{td}{sub-section:NUMBER_des|trigger=button|text=}{sub-section}{sub-section:NUMBER_des|trigger=none|class=sIndent}Constant to be used when the type of a variable needs to be specified.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:NUMBER_snc|trigger=button|text=}{sub-section}{sub-section:NUMBER_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:NUMBER_prs|trigger=button|text=}{sub-section}{sub-section:NUMBER_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:NUMBER_ret|trigger=button|text=}{sub-section}{sub-section:NUMBER_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:NUMBER_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:NUMBER_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:NUMBER_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:NUMBER_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:NUMBER_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:NUMBER_sam|trigger=none}{code:language=javascript}
var numberVar = solutionModel.newGlobalVariable('globals', 'gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(scopes.globals.gNumber); // Prints 192.334
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=TEXT|class=node}{tr:id=name}{td}h6.TEXT{td}{tr}{tr:id=des}{td}{sub-section:TEXT_des|trigger=button|text=}{sub-section}{sub-section:TEXT_des|trigger=none|class=sIndent}Constant to be used when the type of a variable needs to be specified.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:TEXT_snc|trigger=button|text=}{sub-section}{sub-section:TEXT_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:TEXT_prs|trigger=button|text=}{sub-section}{sub-section:TEXT_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:TEXT_ret|trigger=button|text=}{sub-section}{sub-section:TEXT_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:TEXT_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:TEXT_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:TEXT_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:TEXT_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:TEXT_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:TEXT_sam|trigger=none}{code:language=javascript}
var txtVar = solutionModel.newGlobalVariable('globals', 'gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assign a String as default value.
application.output(scopes.globals.gText); // Prints 'some text' (without quotes).
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\
{table:id=property|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=defaultValue|class=node}{tr:id=name}{td}h6.defaultValue{td}{tr}{tr:id=des}{td}{sub-section:defaultValue_des|trigger=button|text=}{sub-section}{sub-section:defaultValue_des|trigger=none|class=sIndent}The default value of the variable.
It is interpreted as a JS expression.
For form variables ,setting this property requires the form instances to be destroyed (history.remove("formName")).
If you want to use a default value for a newly created variable create the variable using the 3 paramaeter version newVariable(name,type,defaultValue).
For INTEGER variables it can be an integer constant, like 10 for example.
For NUMBER variables it can be a real constant, like 22.41. For DATETIME
variables it can be "now", or a JS expression like "new Date()". For TEXT
variables it can be any string surrounded with quotes, like "'some text'".{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:defaultValue_snc|trigger=button|text=}{sub-section}{sub-section:defaultValue_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:defaultValue_prs|trigger=button|text=}{sub-section}{sub-section:defaultValue_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:defaultValue_ret|trigger=button|text=}{sub-section}{sub-section:defaultValue_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:defaultValue_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:defaultValue_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:defaultValue_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:defaultValue_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:defaultValue_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:defaultValue_sam|trigger=none}{code:language=javascript}
var intVar = solutionModel.newGlobalVariable('globals', 'gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(scopes.globals.gInt); // Prints 997
var numberVar = solutionModel.newGlobalVariable('globals', 'gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(scopes.globals.gNumber); // Prints 192.334
var dateVar = solutionModel.newGlobalVariable('globals', 'gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(scopes.globals.gDate); // Prints the current date and time.
var txtVar = solutionModel.newGlobalVariable('globals', 'gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assign a String as default value.
application.output(scopes.globals.gText); // Prints 'some text' (without quotes).
var mediaVar = solutionModel.newGlobalVariable('globals', 'gMedia', JSVariable.MEDIA);
mediaVar.defaultValue = 'new Array(1, 2, 3, 4)';
application.output(scopes.globals.gMedia); // Prints out the array with four elements.
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=name|class=node}{tr:id=name}{td}h6.name{td}{tr}{tr:id=des}{td}{sub-section:name_des|trigger=button|text=}{sub-section}{sub-section:name_des|trigger=none|class=sIndent}The name of the variable.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:name_snc|trigger=button|text=}{sub-section}{sub-section:name_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:name_prs|trigger=button|text=}{sub-section}{sub-section:name_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:name_ret|trigger=button|text=}{sub-section}{sub-section:name_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:name_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:name_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:name_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:name_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:name_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:name_sam|trigger=none}{code:language=javascript}
var gVar = solutionModel.newGlobalVariable('globals', 'gtext', JSVariable.TEXT);
gVar.name = 'anotherName';
gVar.defaultValue = '"default text"';
// The next two lines will print the same output.
application.output(scopes.globals[gVar.name]);
application.output(scopes.globals.anotherName);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=variableType|class=node}{tr:id=name}{td}h6.variableType{td}{tr}{tr:id=des}{td}{sub-section:variableType_des|trigger=button|text=}{sub-section}{sub-section:variableType_des|trigger=none|class=sIndent}The type of the variable. Can be one of: TEXT, INTEGER, NUMBER, DATETIME or MEDIA.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:variableType_snc|trigger=button|text=}{sub-section}{sub-section:variableType_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:variableType_prs|trigger=button|text=}{sub-section}{sub-section:variableType_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:variableType_ret|trigger=button|text=}{sub-section}{sub-section:variableType_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:variableType_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:variableType_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:variableType_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:variableType_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:variableType_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:variableType_sam|trigger=none}{code:language=javascript}
var g Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Constant to be used when the type of a variable needs to be specified. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var numberVar = solutionModel.newGlobalVariable('globals', 'gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(scopes.globals.gNumber); // Prints 192.334 |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Constant to be used when the type of a variable needs to be specified. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var txtVar = solutionModel.newGlobalVariable('globals', 'gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assign a String as default value.
application.output(scopes.globals.gText); // Prints 'some text' (without quotes). |
|
|
|
|
|