Child pages
  • JSBean

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{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}
\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#anchors]
Enables a component to stick to a specific side of form and/or to 
grow or shrink when a window is resized.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#className]
The bean class name.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#enabled]
The enable state of the component, default true.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#formIndex]
The Z index of this component.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#groupID]
A String representing a group ID for this component.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#height]
The height in pixels of the component.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#name]
The name of the component.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#printable]
Flag that tells if the component should be printed or not when the form is printed.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#visible]
The visible property of the component, default true.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#width]
The width in pixels of the component.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#x]
The x coordinate of the component on the form.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#y]
The y coordinate of the component on the form.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[UUID]{td}{td}[#getUUID]\()
Returns the UUID of this component.{td}{tr}{tbody}{table}\\ 

{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=anchors|class=node}{tr:id=name}{td}h6.anchors{td}{tr}{tr:id=des}{td}Enables a component to stick to a specific side of form and/or to 
grow or shrink when a window is resized. 

If opposite anchors are activated then the component with grow or 
shrink with the window. For example if Top and Bottom are activated, 
then the component will grow/shrink when the window is vertically 
resized. If Left and Right are activated then the component
will grow/shrink when the window is horizontally resized. 

If opposite anchors are not activated, then the component will 
keep a constant distance from the sides of the window which
correspond to the activated anchors.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=seesam}{td}*Also seeSample*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var code:language=javascript}
var form = solutionModel.newForm('mediaForm', 'example_data', 'parent_table', 'null', false, 400, 300);
var strechAllDirectionsLabel = form.newLabel('Strech all directions', 10, 10, 380, 280);
strechAllDirectionsLabel.background = 'red';
strechAllDirectionsLabel.anchors = SM_ANCHOR.ALL;	
var strechVerticallyLabel = form.newLabel('Strech vertically', 10, 10, 190, 280);
strechVerticallyLabel.background = 'green';
strechVerticallyLabel.anchors = SM_ANCHOR.WEST | SM_ANCHOR.NORTH | SM_ANCHOR.SOUTH;
var strechHorizontallyLabel = form.newLabel('Strech horizontally', 10, 10, 380, 140);
strechHorizontallyLabel.background = 'blue';
strechHorizontallyLabel.anchors = SM_ANCHOR.NORTH | SM_ANCHOR.WEST | SM_ANCHOR.EAST;
var stickToTopLeftCornerLabel = form.newLabel('Stick to top-left corner', 10, 10, 200, 100);
stickToTopLeftCornerLabel.background = 'orange';
stickToTopLeftCornerLabel.anchors = SM_ANCHOR.NORTH | SM_ANCHOR.WEST; // This is equivalent to SM_ANCHOR.DEFAULT 
var stickToBottomRightCornerLabel = form.newLabel('Stick to bottom-right corner', 190, 190, 200, 100);
stickToBottomRightCornerLabel.background = 'pink';
stickToBottomRightCornerLabel.anchors = SM_ANCHOR.SOUTH | SM_ANCHOR.EAST;
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=className|class=node}{tr:id=name}{td}h6.className{td}{tr}{tr:id=des}{td}The bean class name.{td}{tr}{tr:id=sncret}{td}*SinceReturns*\\ Replace with version info[String]{td}{tr}{tr:id=prssam}{td}*ParametersSample*\\{tddiv:class=sIndent}{tr}{tr:id=ret}{td}*Returns*\\[String]code:language=javascript}
var bean = form.getBean('mybean');
application.output(bean.className);
{code}{div}{td}{tr}{tr:idclass=seelastDetailRow}{td}*Also see*\\{div:class=sIndent}{divtd}{tdtr}{trtbody}{tbody:id=enabled|class=node}{tr:id=link}name}{td}h6.enabled{td}*External links*\\{div:class=sIndent}{div}{tr}{tr:id=des}{td}The enable state of the component, default true.{td}{tr}{tr:id=samret}{td}*SampleReturns*\\{div:class=sIndent}{code: [Boolean]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var beanform = formsolutionModel.getBean('mybean');
application.output(bean.className)newForm('printForm', 'example_data', 'parent_table', 'null', false, 400, 300);
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
field.enabled = false;
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=enabledformIndex|class=node}{tr:id=name}{td}h6.enabledformIndex{td}{tr}{tr:id=des}{td}The enableZ state of the component, default trueindex of this component. If two components overlap,
then the component with higher Z index is displayed above
the component with lower Z index.{td}{tr}{tr:id=sncret}{td}*SinceReturns*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[Boolean[Number]{td}{tr}{tr:id=seesam}{td}*Also seeSample*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var form = solutionModel.newForm('printForm', 'example_data', 'parent_table', 'null', false, 400, 300);
var fieldcode:language=javascript}
var labelBelow = form.newLabel('Green', 10, 10, 100, 50);
labelBelow.background = 'green';	
labelBelow.formIndex = 10;
var fieldAbove = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20)30);
fieldAbove.background = '#FF0000';
fieldfieldAbove.enabledformIndex = false20;
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=formIndexgroupID|class=node}{tr:id=name}{td}h6.formIndexgroupID{td}{tr}{tr:id=des}{td}The Z index ofA String representing a group ID for this component. If twoseveral
components overlap,have then the component with higher Z index is displayed above
the component with lower Z index.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{same group ID then they belong to the same
group of components. Using the group itself, all components can
be disabled/enabled or made invisible/visible.
The group id should be a javascript compatible identifier to allow access of the group in scripting.{td}{tr}{tr:id=ret}{td}*Returns*\\ [NumberString]{td}{tr}{tr:id=seesam}{td}*Also seeSample*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var labelBelow = form.newLabel('Green', 10, 10, 100, 50);
labelBelow.background = 'green';	
labelBelow.formIndex = 10;
var fieldAbovecode:language=javascript}
var form = solutionModel.newForm('someForm', 'example_data', 'parent_table', 'null', false, 400, 300);
var label = form.newLabel('Green', 10, 10, 100, 20);
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 1040, 100, 3020);
fieldAbovelabel.backgroundgroupID = '#FF0000someGroup';
fieldAbovefield.formIndexgroupID = 20'someGroup';
{code}{div}{	
forms['someForm'].elements.someGroup.enabled = false;
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=groupIDheight|class=node}{tr:id=name}{td}h6.groupIDheight{td}{tr}{tr:id=des}{td}AThe Stringheight representingin apixels group ID for thisof the component. If several
components have the same group ID then they belong to the same
group of components. Using the group itself, all components can
be disabled/enabled or made invisible/visible.
The group id should be a javascript compatible identifier to allow access of the group in scripting.{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
application.output('original width: ' + field.width);
application.output('original height: ' + field.height);
field.width = 200;
field.height = 100;
application.output('modified width: ' + field.width);
application.output('modified height: ' + field.height);
{code}{div}{td}{tr}{tr:idclass=snclastDetailRow}{td}*Since*\\ Replace with version info{td}{tr}{trtbody}{tbody:id=name|class=prsnode}{td}*Parameters*\\tr:id=name}{td}h6.name{td}{tr}{tr:id=retdes}{td}*Returns*\\[String]The name of the component. Through this name it can also accessed in methods.{td}{tr}{tr:id=seeret}{td}*Also seeReturns*\\{div:class=sIndent}{div} [String]{td}{tr}{tr:id=linksam}{td}*External linksSample*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}code:language=javascript}
var form = solutionModel.newForm('someForm', 'example_data', 'parent_table', 'null', false, 400620, 300);
var label = form.newLabel('GreenLabel', 10, 10, 100150, 20150);
varlabel.name field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 40, 100, 20);
label.groupID = 'someGroup';
field.groupID = 'someGroup';	'myLabel'; // Give a name to the component.
forms['someForm'].controller.show()
// Now use the name to access the component.
forms['someForm'].elements.someGroup.enabled['myLabel'].text = 'Updated falsetext';
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=heightprintable|class=node}{tr:id=name}{td}h6.heightprintable{td}{tr}{tr:id=des}{td}TheFlag heightthat in pixels of the componenttells if the component should be printed or not when the form is printed.

By default components are printable.{td}{tr}{tr:id=sncret}{td}*SinceReturns*\\ Replace with version info[Boolean]{td}{tr}{tr:id=prssam}{td}*ParametersSample*\\{tddiv:class=sIndent}{tr}{tr:id=ret}{td}*Returns*\\[Number]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
application.output('original width: ' + field.width);
application.output('original height: ' + field.height);
field.width = 200;
field.height = 100;
application.output('modified width: ' + field.width);
application.output('modified height: ' + field.height);
{code}{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}The name of the component. Through this name it can also accessed in methods.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[String]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var form = solutionModel.newForm('someForm', 'example_data', 'parent_table', 'null', false, 620, 300);
var label = form.newLabel('Label', 10, 10, 150, 150);
label.name = 'myLabel'; // Give a name to the component.
forms['someForm'].controller.show()
// Now use the name to access the component.
forms['someForm'].elements['myLabel'].text = 'Updated text';
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=printable|class=node}{tr:id=name}{td}h6.printable{td}{tr}{tr:id=des}{td}Flag that tells if the component should be printed or not when the form is printed.

By default components are printable.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[Boolean]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var form = solutionModel.newForm('printForm', 'example_data', 'parent_table', 'null', false, 400, 300);
var printedField = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
var notPrintedField = form.newField('parent_table_id', JSField.TEXT_FIELD, 10, 40, 100, 20);
notPrintedField.printable = false; // This field won't show up in print preview and won't be printed.
forms['printForm'].controller.showPrintPreview()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=visible|class=node}{tr:id=name}{td}h6.visible{td}{tr}{tr:id=des}{td}The visible property of the component, default true.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[Boolean]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var form code:language=javascript}
var form = solutionModel.newForm('printForm', 'example_data', '', 'parent_table', 'null', false, 400, 300);
var printedField = form.newField('parent_table_text', 'null'JSField.TEXT_FIELD, 10, false10, 400100, 30020);
var fieldnotPrintedField = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
field.visible = false;
{code}{div}id', JSField.TEXT_FIELD, 10, 40, 100, 20);
notPrintedField.printable = false; // This field won't show up in print preview and won't be printed.
forms['printForm'].controller.showPrintPreview()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=visible|class=node}{tr:id=name}{td}h6.visible{td}{tr}{tr:classid=lastDetailRowdes}{td}The visible property of the component, default true.{td}{tr}{tbody}{tbodytr:id=width|class=noderet}{td}*Returns*\\ [Boolean]{td}{tr}{tr:id=namesam}{td}h6.width{td}{tr}{tr:id=des}{td}The width in pixels of the component.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\*Sample*\\{div:class=sIndent}{code:language=javascript}
var form = solutionModel.newForm('printForm', 'example_data', 'parent_table', 'null', false, 400, 300);
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
field.visible = false;
{code}{div}{td}{tr}{tr:idclass=retlastDetailRow}{td}*Returns*\\[Number]{td}{tr}{trtbody}{tbody:id=width|class=seenode}{td}*Also see*\\{div:class=sIndent}{div}tr:id=name}{td}h6.width{td}{tr}{tr:id=linkdes}{td}*External links*\\{div:class=sIndent}{div}The width in pixels of the component.{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
application.output('original width: ' + field.width);
application.output('original height: ' + field.height);
field.width = 200;
field.height = 100 10, 100, 20);
application.output('modifiedoriginal width: ' + field.width);
application.output('modifiedoriginal height: ' + field.height);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=x|class=node}{tr:id=name}{td}h6.x{td}{tr}{tr:id=des}{td}The x coordinate of the component on the form.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version infofield.width = 200;
field.height = 100;
application.output('modified width: ' + field.width);
application.output('modified height: ' + field.height);
{code}{div}{td}{tr}{tr:idclass=prslastDetailRow}{td}*Parameters*\\{td}{tr}{tbody}{tbody:id=x|class=node}{tr:id=retname}{td}*Returns*\\[Number]h6.x{td}{tr}{tr:id=seedes}{td}*Also see*\\{div:class=sIndent}{div}The x coordinate of the component on the form.{td}{tr}{tr:id=linkret}{td}*External linksReturns*\\{div:class=sIndent}{div} [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
application.output('original location: ' + field.x + ', ' + field.y);
field.x = 90;
field.y = 90 20);
application.output('changedoriginal location: ' + field.x + ', ' + field.y);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=y|class=node}{tr:id=name}{td}h6.y{td}{tr}{tr:id=des}{td}The y coordinate of the component on the form.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version infofield.x = 90;
field.y = 90;
application.output('changed location: ' + field.x + ', ' + field.y);
{code}{div}{td}{tr}{tr:idclass=prslastDetailRow}{td}*Parameters*\\{td}{tr}{tbody}{tbody:id=y|class=node}{tr:id=retname}{td}*Returns*\\[Number]h6.y{td}{tr}{tr:id=seedes}{td}*Also see*\\{div:class=sIndent}{div}The y coordinate of the component on the form.{td}{tr}{tr:id=linkret}{td}*External linksReturns*\\{div:class=sIndent}{div} [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
application.output('original location: ' + field.x + ', ' + field.y);
field.x = 90;
field.y = 90
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
application.output('changedoriginal location: ' + field.x + ', ' + field.y);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{thfield.x = 90;
field.y = 90;
application.output('changed location: ' + field.x + ', ' + field.y);
{code}{div}{td}{tr}{tbodytr:id=getUUID|class=nodelastDetailRow}{tr:id=name}{td}h6.getUUID{td}{tr}{tr:id=sigtbody}{tdtable}\\ 

{span:style=float: left; margin-right: 5px;}[UUID]{span}{span:id=iets|style=float: left; font-weight: bold;}getUUID{span}{span:id=iets|style=float: left;}\(){span}{tdtable:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{trtbody:id=getUUID|class=des}{td}Returns the UUID of this component.node}{tr:id=name}{td}h6.getUUID{td}{tr}{tr:id=sncsig}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[UUID]{span:style=float: left; margin-right: 5px;}[UUID]{span}{span:id=iets|style=float: left; font-weight: bold;}getUUID{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=seedes}{td}*Also see*\\{div:class=sIndent}{div}{Returns the UUID of this component.{td}{tr}{tr:id=linkret}{td}*External linksReturns*\\{div:class=sIndent}{div} [UUID]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var button_uuid = solutionModel.getForm("my_form").getButton("my_button").getUUID();
application.output(button_uuid.toString());
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}