Div |
---|
|
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' |
HTML Table |
---|
id | |
---|
class | servoy sReturnTypes |
---|
|
|
...
...
...
Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Property Summary |
|
|
|
...
...
...
...
displaysTags Flag that enables or disables merging of data inside components using tags (placeholders). |
|
|
...
...
enabled The enable state of the component, default true. |
|
|
...
...
format The format that should be applied when displaying data(using dataProviderID) in the label/button. |
|
|
...
...
...
labelSize Size property for a label, values 1 to 60 correspond to header class h1 to h6 |
|
|
...
...
name The name of the component. |
|
|
...
...
Table Cell (td) |
---|
#onAction The method that is executed when the component is clicked. |
...
...
styleClass The name of the style class that should be applied to this component. |
|
|
...
...
text The text that is displayed inside the component. |
|
|
...
...
visible The visible property of the component, default true. |
|
|
...
...
...
x The x coordinate of the component on the form. |
|
|
...
...
y The y coordinate of the component on the form. |
|
|
...
...
...
...
Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Summary |
|
|
|
...
...
getTitle() Get title label for the label. |
|
|
HTML Table |
---|
id | property |
---|
class | servoy sDetail |
---|
|
|
...
...
...
...
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
dataProviderID |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| The dataprovider of the component. |
|
|
|
|
...
// 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) |
---|
Div |
---|
| Flag that enables or disables merging of data inside components using tags (placeholders). Tags (or placeholders) are words surrounded by %%on each side. There are data tags and standard tags. Data tags consist in names of dataproviders surrounded by%%. Standard tags are a set of predefined tags that are made available by the system. See the "Merging data" section for more details about tags. The default value of this flag is "false", that is merging of data is disabled by default. |
|
|
|
|
...
var label = form.newLabel('You are viewing record no. %%parent_table_id%%. You are running on server %%serverURL%%.', |
|
|
|
|
|
...
10, 10, 600, 100);
label.displaysTags = true; |
|
|
|
|
|
...
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| The enable state of the component, default true. |
|
|
|
|
...
var form = solutionModel.newForm('printForm', 'db:/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) |
---|
Div |
---|
| The format that should be applied when displaying data(using dataProviderID) in the label/button. Some examples are "#%", "dd-MM-yyyy", "MM-dd-yyyy", etc. |
|
|
|
|
...
var label = form.newLabel('', 10, 10, 100, 100);
label.format = '$#.00'; |
|
|
|
|
|
...
...
height
...
Size property for a label, values 1 to 60 correspond to header class h1 to h6 |
|
|
|
|
...
...
...
...
...
...
...
Table Row (tr) |
---|
|
Table Cell (td) |
---|
Div |
---|
| Size property for a label, values 1 to 60 correspond to header class h1 to h6 |
|
|
Table Row (tr) |
---|
|
Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var label = form.newLabel('Hello', 1);
label.labelSize = 2 // corresponds to header class h2
|
|
|
|
...
...
Table Row (tr) |
---|
|
Table Cell (td) |
---|
Div |
---|
| 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', 'db:/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 Row (tr) |
---|
|
Table Cell (td) |
---|
Div |
---|
| The method that is executed when the component is clicked. |
|
|
Table Row (tr) |
---|
|
Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var doNothingMethod = form.newMethod('function doNothing() { application.output("Doing nothing."); }');
var onClickMethod = form.newMethod('function onClick(event) { application.output("I was clicked at " + event.getTimestamp()); }');
var onDoubleClickMethod = form.newMethod('function onDoubleClick(event) { application.output("I was double-clicked at " + event.getTimestamp()); }');
var onRightClickMethod = form.newMethod('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 Row (tr) |
---|
|
Table Cell (td) |
---|
styleClass |
|
...
...
The name of the style class that should be applied to this component.
...
label.labelSize = 2 // corresponds to header class h2 |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| The name of the component. Through this name it can also accessed in methods. |
|
|
|
|
...
var form = solutionModel.newForm(' |
|
|
|
|
|
...
someForm', 'db:/example_data/ |
|
|
|
|
|
...
parent_table', null, false, 620, 300);
var label = form.newLabel('Label', |
|
|
|
|
|
...
...
...
...
...
...
...
...
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) |
---|
styleClass |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| 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', 'db:/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'; // |
|
|
|
|
|
...
...
...
...
...
...
...
...
...
...
fancy'; // Then set the style class on the field. |
|
|
|
|
|
...
visible
...
text that is displayed inside the component |
|
|
|
|
...
...
...
...
...
text is specified when creating the component.
var label = form. |
|
|
|
|
|
...
...
...
...
// But it can be changed later if needed.
label.text = |
|
|
|
|
|
...
...
...
width
...
...
...
...
...
...
...
...
...
'db:/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; |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| The x coordinate of the component on the form. |
|
|
|
|
...
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;
application.output('changed location: ' + field.x + ', ' + field.y); |
|
|
|
|
|
...
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| The y coordinate of the component on the form. |
|
|
|
|
...
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;
application.output('changed location: ' + field.x + ', ' + field.y); |
|
|
|
|
|
...
HTML Table |
---|
id | function |
---|
class | servoy sDetail |
---|
|
Colgroup Tag |
---|
columnpadding0px |
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get title label for the label. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
|
var form = solutionModel.newForm('someForm', 'db:/example_data/parent_table');
var label = form.newLabel('Customers', 1);
label.getTitle().text = 'Some text'
forms['someForm'].controller.show()
|
|
|
|
|
|