;
// But it can be changed if needed.
cal.dataProviderID = 'my_table_text';
cal.displayType = JSField.TEXT_FIELD;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The dataprovider of the component. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// Normally the dataprovider is specified when a component is created.
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 40, 100, 20);
// But it can be modified later if needed.
field.dataProviderID = 'parent_table_id';
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Flag that tells if the content of the field can be edited or not. The default value of this flag is "true", that is the content can be edited. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var field = form.newField('my_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20);
field.editable = false;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The enable state of the component, default true. |
|
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);
field.enabled = false;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The font type of the component. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var label = form.newLabel('Text here', 10, 50, 100, 20);
label.fontType = solutionModel.createFont('Times New Roman',1,14);
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
foreground |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
The foreground color of the component. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// This property can be used on all types of components.
// Here it is illustrated only for labels and fields.
var labelWithBlueText = form.newLabel('Blue text', 10, 10, 100, 30);
labelWithBlueText.foreground = 'blue'; // Use generic names for colors.
var fieldWithYellowText = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 50, 100, 20);
fieldWithYellowText.foreground = '#FFFF00'; // Use RGB codes for colors.
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The Z index of this component. If two components overlap, then the component with higher Z index is displayed above the component with lower Z index. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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, 30);
fieldAbove.background = '#FF0000';
fieldAbove.formIndex = 20;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
The format that should be applied when displaying the data in the component. Some examples are "#%", "dd-MM-yyyy", "MM-dd-yyyy", etc. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var field = form.newField('my_table_number', JSField.TEXT_FIELD, 10, 10, 100, 20);
field.format = '$#.00';
|
|
|
|
|
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_ |
|
|
|
|
|