Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
A String representing a group ID for this 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. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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, 40, 100, 20);
label.groupID = 'someGroup';
field.groupID = 'someGroup';
forms['someForm'].elements.someGroup.enabled = false;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The height in pixels of the component. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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);
|
|
|
|
|
Table Body (tbody) |
---|
id | horizontalAlignment |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
horizontalAlignment |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Horizontal alignment of the text inside the component. Can be one of LEFT, CENTER or RIGHT. Note that this property does not refer to the horizontal alignment of the component inside the form. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var leftAlignedLabel = form.newLabel('LEFT', 10, 10, 300, 20);
leftAlignedLabel.horizontalAlignment = SM_ALIGNMENT.LEFT;
var hCenteredLabel = form.newLabel('CENTER', 10, 40, 300, 20);
hCenteredLabel.horizontalAlignment = SM_ALIGNMENT.CENTER;
var rightAlignedLabel = form.newLabel('RIGHT', 10, 70, 300, 20);
rightAlignedLabel.horizontalAlignment = SM_ALIGNMENT.RIGHT;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The margins of the component. They are specified in this order, separated by commas: top, right, bottom, left. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var label = form.newLabel('Label', 10, 10, 150, 150);
label.background = 'yellow';
label.margin = '10,20,30,40';
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The name of the component. Through this name it can also accessed in methods. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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';
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The method that is executed when the component is clicked. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var doNothingMethod = form.newFormMethod('function doNothing() { application.output("Doing nothing."); }');
var onClickMethod = form.newFormMethod('function onClick(event) { application.output("I was clicked at " + event.getTimestamp()); }');
var onDoubleClickMethod = form.newFormMethod('function onDoubleClick(event) { application.output("I was double-clicked at " + event.getTimestamp()); }');
var onRightClickMethod = form.newFormMethod('function onRightClick(event) { application.output("I was right-clicked at " + event.getTimestamp()); }');
// At creation the button has the 'doNothing' method as onClick handler, but we'll change that later.
var btn = form.newButton('I am a button', 10, 40, 200, 20, doNothingMethod);
btn.onAction = onClickMethod;
btn.onDoubleClick = onDoubleClickMethod;
btn.onRightClick = onRightClickMethod;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
onDataChange |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Method that is executed when the data in the component is successfully changed. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var form = solutionModel.newForm('someForm', 'example_data', 'parent_table', 'null', false, 620, 300);
var onDataChangeMethod = form.newFormMethod('function onDataChange(oldValue, newValue, event) { application.output("Data changed from " + oldValue + " to " + newValue + " at " + event.getTimestamp()); }');
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
field.onDataChange = onDataChangeMethod;
forms['someForm'].controller.show();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
onFocusGained |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
The method that is executed when the component gains focus. NOTE: Do not call methods that will influence the focus itself. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var form = solutionModel.newForm('someForm', 'example_data', 'parent_table', 'null', false, 620, 300);
var onFocusLostMethod = form.newFormMethod('function onFocusLost(event) { application.output("Focus lost at " + event.getTimestamp()); }');
var onFocusGainedMethod = form.newFormMethod('function onFocusGained(event) { application.output("Focus gained at " + event.getTimestamp()); }');
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
field.onFocusGained = onFocusGainedMethod;
field.onFocusLost = onFocusLostMethod;
forms['someForm'].controller.show()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
onFocusLost |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
The method that is executed when the component looses focus. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var form = solutionModel.newForm('someForm', 'example_data', 'parent_table', 'null', false, 620, 300);
var onFocusLostMethod = form.newFormMethod('function onFocusLost(event) { application.output("Focus lost at " + event.getTimestamp()); }');
var onFocusGainedMethod = form.newFormMethod('function onFocusGained(event) { application.output("Focus gained at " + event.getTimestamp()); }');
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
field.onFocusGained = onFocusGainedMethod;
field.onFocusLost = onFocusLostMethod;
forms['someForm'].controller.show()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The method that is executed when the component is rendered. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
field.onRender = form.newFormMethod('function onRender(event) { event.getElement().bgcolor = \'#00ff00\' }');
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
onRightClick |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
The method that is executed when the component is right clicked. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var doNothingMethod = form.newFormMethod('function doNothing() { application.output("Doing nothing."); }');
var onClickMethod = form.newFormMethod('function onClick(event) { application.output("I was clicked at " + event.getTimestamp()); }');
var onDoubleClickMethod = form.newFormMethod('function onDoubleClick(event) { application.output("I was double-clicked at " + event.getTimestamp()); }');
var onRightClickMethod = form.newFormMethod('function onRightClick(event) { application.output("I was right-clicked at " + event.getTimestamp()); }');
// At creation the button has the 'doNothing' method as onClick handler, but we'll change that later.
var btn = form.newButton('I am a button', 10, 40, 200, 20, doNothingMethod);
btn.onAction = onClickMethod;
btn.onDoubleClick = onDoubleClickMethod;
btn.onRightClick = onRightClickMethod;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
printSliding |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Enables an element to resize based on its content and/or move when printing. The component can move horizontally or vertically and can grow or shrink in height and width, based on its content and the content of neighboring components. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var form = solutionModel.newForm('printForm', 'example_data', 'parent_table', 'null', false, 400, 300);
var slidingLabel = form.newLabel('Some long text here', 10, 10, 5, 5);
slidingLabel.printSliding = SM_PRINT_SLIDING.GROW_HEIGHT | SM_PRINT_SLIDING.GROW_WIDTH;
slidingLabel.background = 'gray';
forms['printForm'].controller.showPrintPreview();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Flag that tells if the component should be printed or not when the form is printed. By default components are printable. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Scrollbar options for the vertical and horizontal scrollbars. Each of the vertical and horizontal scrollbars can be configured to display all the time, to display only when needed or to never display. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var noScrollbars = form.newField('my_table_text', JSField.TEXT_AREA, 10, 10, 100, 100);
noScrollbars.scrollbars = SM_SCROLLBAR.HORIZONTAL_SCROLLBAR_NEVER | SM_SCROLLBAR.VERTICAL_SCROLLBAR_NEVER;
var neededScrollbars = form.newField('my_table_text', JSField.TEXT_AREA, 120, 10, 100, 100);
neededScrollbars.scrollbars = SM_SCROLLBAR.HORIZONTAL_SCROLLBAR_AS_NEEDED | SM_SCROLLBAR.VERTICAL_SCROLLBAR_AS_NEEDED;
var alwaysScrollbars = form.newField('my_table_text', JSField.TEXT_AREA, 230, 10, 100, 100);
alwaysScrollbars.scrollbars = SM_SCROLLBAR.HORIZONTAL_SCROLLBAR_ALWAYS | SM_SCROLLBAR.VERTICAL_SCROLLBAR_ALWAYS;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
selectOnEnter |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Flag that tells if the content of the field should be automatically selected when the field receives focus. The default value of this field is "false". |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// Create two fields and set one of them to have "selectOnEnter" true. As you tab
// through the fields you can notice how the text inside the second field gets
// automatically selected when the field receives focus.
var fieldNoSelect = form.newField('my_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
var fieldSelect = form.newField('my_table_text', JSField.TEXT_FIELD, 10, 40, 100, 20);
fieldSelect.selectOnEnter = true;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
styleClass |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
The name of the style class that should be applied to this component. When defining style classes for specific component types, their names must be prefixed according to the type of the component. For example in order to define a class names 'fancy' for fields, in the style definition the class must be named 'field.fancy'. If it would be intended for labels, then it would be named 'label.fancy'. When specifying the class name for a component, the prefix is dropped however. Thus the field or the label will have its styleClass property set to 'fancy' only. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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);
var style = solutionModel.newStyle('myStyle','field.fancy { background-color: yellow; }');
form.styleName = 'myStyle'; // First set the style on the form.
field.styleClass = 'fancy'; // Then set the style class on the field.
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
An index that specifies the position of the component in the tab sequence. The components are put into the tab sequence in increasing order of this property. A value of 0 means to use the default mechanism of building the tab sequence (based on their location on the form). A value of -2 means to remove the component from the tab sequence. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// Create three fields. Based on how they are placed, by default they will come one
// after another in the tab sequence.
var fieldOne = form.newField('parent_table_id', JSField.TEXT_FIELD, 10, 10, 100, 20);
var fieldTwo = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 40, 100, 20);
var fieldThree = form.newField('parent_table_id', JSField.TEXT_FIELD, 10, |
|
|
|
|
|