The css classes to be output for html tag. |
|
The id to be output for html tag. |
|
Get/set container height. |
|
The name of the component. |
|
returns the layouts package name |
|
returns the layouts spec name |
|
The style definition to be output in html tag. |
|
The tag type for html output. |
|
|
Returns a JSLayoutContainer that has the given name throughout the whole form hierarchy. |
|
Returns a JSWebComponent that has the given name through the whole hierarchy of JSLayoutContainers |
|
Returns the comment of this container. |
|
Returns a JSComponent that has the given name; if found it will be a JSField, JSLabel, JSButton, JSPortal, JSBean, JSWebComponent or JSTabPanel. |
|
Returns a array of all the JSComponents that a form has; they are of type JSField,JSLabel,JSButton,JSPortal,JSBean, JSWebComponents or JSTabPanel. |
|
Returns a array of all the JSComponents that a form has; they are of type JSField,JSLabel,JSButton,JSPortal,JSBean, JSWebComponent or JSTabPanel. |
|
Returns a JSLayoutContainer that has the given name of this container. |
|
Returns all JSLayoutContainers objects of this container. |
|
Returns all JSLayoutContainers objects of this container |
|
Returns a JSWebComponent that has the given name that is a child of this layout container. |
|
Returns all JSWebComponents of this form/container. |
|
Returns all JSWebComponents of this form/container. |
|
Create a new layout container as the last child of its parent container. |
|
Create a new layout container. |
|
Create a new layout container. |
|
Create a new layout container as the last child in its parent container. |
|
Creates a new JSWebComponent (spec based component) object on the RESPONSIVE form. |
|
Creates a new JSWebComponent (spec based component) object on the RESPONSIVE form. |
|
Creates a new JSWebComponent (spec based component) object on the RESPONSIVE form,
as the last component in its parent container. |
|
Creates a new JSWebComponent (spec based component) object on the RESPONSIVE form. |
|
Creates a new JSWebComponent (spec based component) object on the form. |
|
Remove a layout container (with all its children) from hierarchy. |
|
Removes a component (JSLabel, JSButton, JSField, JSPortal, JSBean, JSTabpanel, JSWebComponent) that has the given name. |
|
Removes a JSWebComponent that has the specified name. |
|
|
The css classes to be output for html tag. |
|
|
Sample layoutContainer.cssClasses = 'myContainer'; |
|
|
|
|
The id to be output for html tag. |
|
|
Sample layoutContainer.elementId = 'rowCol'; |
|
|
|
|
Get/set container height. This is only used for CSS Position Container. |
|
|
Sample layoutContainer.height = 300; |
|
|
|
|
The name of the component. Through this name it can also accessed in methods.
Must be a valid javascript name. (no - in the name or start with number) |
|
|
Sample layoutContainer.name = 'col1'; |
|
|
|
|
returns the layouts package name |
|
|
|
returns the layouts spec name |
|
|
|
The style definition to be output in html tag. |
|
|
Sample layoutContainer.style = "background-color:red"; |
|
|
|
|
The tag type for html output. Default value is 'div'. |
|
|
Sample layoutContainer.tagType = 'span'; |
|
|
|
|
Get/set x location. Location is used for ordering in html output. |
|
|
Sample layoutContainer.x = 100;; |
|
|
|
|
Get/set Y location. Location is used for ordering in html output. |
|
|
Sample layoutContainer.y = 100;; |
|
|
|
|
|
findLayoutContainer(name) |
|
Returns a JSLayoutContainer that has the given name throughout the whole form hierarchy. |
|
|
Parameters the specified name of the container |
|
|
|
|
Sample var container = myForm.findLayoutContainer("row1");
application.output(container.name); |
|
|
|
|
Returns a JSWebComponent that has the given name through the whole hierarchy of JSLayoutContainers |
|
|
Parameters the specified name of the web component |
|
|
|
|
Sample var btn = myForm.findWebComponent("mycomponent");
application.output(mybean.typeName); |
|
|
|
|
Sample layoutContainer.getAttribute('class'); |
|
|
|
|
Returns the comment of this container. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var comment = solutionModel.getForm("my_form").getComment();
application.output(comment); |
|
|
|
|
Returns a JSComponent that has the given name; if found it will be a JSField, JSLabel, JSButton, JSPortal, JSBean, JSWebComponent or JSTabPanel. |
|
|
Parameters the specified name of the component |
|
|
|
|
Returns JSComponent a JSComponent object (might be a JSField, JSLabel, JSButton, JSPortal, JSBean, JSWebComponent or JSTabPanel) |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var frm = solutionModel.getForm("myForm");
var cmp = frm.getComponent("componentName");
application.output("Component type and name: " + cmp); |
|
|
|
|
Returns a array of all the JSComponents that a form has; they are of type JSField,JSLabel,JSButton,JSPortal,JSBean, JSWebComponents or JSTabPanel. |
|
|
Returns Array an array of all the JSComponents on the form. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var form = solutionModel.getForm("myForm");
var components = form.getComponents();
for (var i in components)
application.output("Component type and name: " + components[i]); |
|
|
|
|
getComponents(returnInheritedElements) |
|
Returns a array of all the JSComponents that a form has; they are of type JSField,JSLabel,JSButton,JSPortal,JSBean, JSWebComponent or JSTabPanel. |
|
|
Parameters true to also return the elements from the parent form |
|
|
|
|
Returns Array an array of all the JSComponents on the form. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var form = solutionModel.getForm("myForm");
var components = form.getComponents();
for (var i in components)
application.output("Component type and name: " + components[i]); |
|
|
|
|
Returns a JSLayoutContainer that has the given name of this container.
Use findLayoutContainer() method to find a JSLayoutContainter through the hierarchy |
|
|
Parameters the specified name of the container |
|
|
|
|
Sample var container = myForm.getLayoutContainer("row1");
application.output(container.name); |
|
|
|
|
Returns all JSLayoutContainers objects of this container.
Does not return the inherited containers, use #getLayoutContainers(true) to get the inherited as well. |
|
|
Returns Array all JSLayoutContainers objects of this container |
|
|
Sample var frm = solutionModel.getForm("myForm");
var containers = frm.getLayoutContainers();
for (var c in containers)
{
var fname = containers[c].name;
application.output(fname);
} |
|
|
|
|
getLayoutContainers(returnInheritedElements) |
|
Returns all JSLayoutContainers objects of this container |
|
|
Parameters true to also return the elements from parent form |
|
|
|
|
Returns Array all JSLayoutContainers objects of this container |
|
|
Sample var frm = solutionModel.getForm("myForm");
var containers = frm.getLayoutContainers();
for (var c in containers)
{
var fname = containers[c].name;
application.output(fname);
} |
|
|
|
|
Returns a JSWebComponent that has the given name that is a child of this layout container.
Use findWebComponent() to find a webcomponent through the hierarchy |
|
|
Parameters the specified name of the web component |
|
|
|
|
Sample var btn = myForm.getWebComponent("mycomponent");
application.output(mybean.typeName); |
|
|
|
|
Returns all JSWebComponents of this form/container.
If this method is called on a form, then it will return all web components on that form.
If the form is responsive, it will return the web components from all the containers.
It does not return the inherited components, use #getWebComponents(true) to get the inherited as well. |
|
|
Returns Array the list of all JSWebComponent on this forms |
|
|
Sample var webComponents = myForm.getWebComponents();
for (var i in webComponents)
{
if (webComponents[i].name != null)
application.output(webComponents[i].name);
} |
|
|
|
|
getWebComponents(returnInheritedElements) |
|
Returns all JSWebComponents of this form/container.
If this method is called on a form, then it will return all web components on that form.
If the form is responsive, it will return the web components from all the containers. |
|
|
Parameters true to also return the elements from parent form |
|
|
|
|
Returns Array the list of all JSWebComponents on this forms |
|
|
Sample var webComponents = myForm.getWebComponents(false);
for (var i in webComponents)
{
if (webComponents[i].name != null)
application.output(webComponents[i].name);
} |
|
|
|
|
Create a new layout container as the last child of its parent container.
This method can only be used in responsive forms.
If you want to use default values and so on from a layout package (like 12grid) or if you use the solution model
to create a form that is saved back into the workspace (servoyDeveloper.save(form)) then you have to set the
packageName and specName properties. So that it works later on in the designer.
If the packageName and specName are not provided, then:
the packageName is the same as for the parent container
the specName is the first allowed child defined in the specification of the parent container
If the specification of the parent container does not defined allowed children, then if it is not empty
the packageName and the specName are copied from the first child layout container. |
|
|
Sample var container = form.newLayoutContainer();
container.packageName = "12grid";
container.specName = "row"; |
|
|
|
|
newLayoutContainer(position) |
|
Create a new layout container. The position is used to determine the generated order in html markup.
This method can only be used in responsive forms.
If you want to use default values and so on from a layout package (like 12grid) or if you use the solution model
to create a form that is saved back into the workspace (servoyDeveloper.save(form)) then you have to set the
packageName and specName properties. So that it works later on in the designer.
If the packageName and specName are not provided, then:
the packageName is the same as for the parent container
the specName is the first allowed child defined in the specification of the parent container
If the specification of the parent container does not defined allowed children, then if it is not empty
the packageName and the specName are copied from the first child layout container. |
|
|
Parameters the position of JSWebComponent object in its parent container |
|
|
|
|
Sample var container = form.newLayoutContainer(1);
container.packageName = "12grid";
container.specName = "row"; |
|
|
|
|
newLayoutContainer(position, spec) |
|
Create a new layout container. The position is used to determine the generated order in html markup.
This method can only be used in responsive forms. |
|
|
Parameters the position of JSWebComponent object in its parent container |
|
a string of the form 'packageName-layoutName', or 'layoutName' |
|
|
|
|
Sample var container = form.newLayoutContainer(1, "12grid-row");
container.newLayoutContainer(1, "column"); |
|
|
|
|
Create a new layout container as the last child in its parent container.
This method can only be used in responsive forms. |
|
|
Parameters a string of the form 'packageName-layoutName', or 'layoutName' |
|
|
|
|
Sample var container = form.newLayoutContainer(1, "12grid-row");
container.newLayoutContainer(1, "column"); |
|
|
|
|
Creates a new JSWebComponent (spec based component) object on the RESPONSIVE form.
Will receive a generated name. Will be added as last position in container. |
|
|
Parameters the webcomponent name as it appears in the spec |
|
|
|
|
Sample var form = solutionModel.newForm('newForm1', 'db:/server1/table1', null, true, 800, 600);
var container = myForm.getLayoutContainer("row1")
var bean = container.newWebComponent('mypackage-testcomponent'); |
|
|
|
|
newWebComponent(type, position) |
|
Creates a new JSWebComponent (spec based component) object on the RESPONSIVE form.
Will receive a generated name. |
|
|
Parameters the webcomponent name as it appears in the spec |
|
the position of JSWebComponent object in its parent container |
|
|
|
|
Sample var form = solutionModel.newForm('newForm1', 'db:/server1/table1', null, true, 800, 600);
var container = myForm.getLayoutContainer("row1")
var bean = container.newWebComponent('mypackage-testcomponent',1); |
|
|
|
|
newWebComponent(name, type) |
|
Creates a new JSWebComponent (spec based component) object on the RESPONSIVE form,
as the last component in its parent container. |
|
|
Parameters the specified name of the JSWebComponent object |
|
the webcomponent name as it appears in the spec |
|
|
|
|
Sample var form = solutionModel.newForm('newForm1', 'db:/server1/table1', null, true, 800, 600);
var container = myForm.getLayoutContainer("row1")
var bean = container.newWebComponent('bean','mypackage-testcomponent'); |
|
|
|
|
newWebComponent(name, type, position) |
|
Creates a new JSWebComponent (spec based component) object on the RESPONSIVE form. |
|
|
Parameters the specified name of the JSWebComponent object |
|
the webcomponent name as it appears in the spec |
|
the position of JSWebComponent object in its parent container |
|
|
|
|
Sample var form = solutionModel.newForm('newForm1', 'db:/server1/table1', null, true, 800, 600);
var container = myForm.getLayoutContainer("row1")
var bean = container.newWebComponent('bean','mypackage-testcomponent',1); |
|
|
|
|
newWebComponent(name, type, x, y, width, height) |
|
Creates a new JSWebComponent (spec based component) object on the form. |
|
|
Parameters the specified name of the JSWebComponent object |
|
the webcomponent name as it appears in the spec |
|
the horizontal "x" position of the JSWebComponent object in pixels |
|
the vertical "y" position of the JSWebComponent object in pixels |
|
the width of the JSWebComponent object in pixels |
|
the height of the JSWebComponent object in pixels |
|
|
|
|
Sample var form = solutionModel.newForm('newForm1', 'db:/server1/table1', null, true, 800, 600);
var bean = form.newWebComponent('bean','mypackage-testcomponent',200,200,300,300);
forms['newForm1'].controller.show(); |
|
|
|
|
Sample layoutContainer.putAttribute('class','container fluid'); |
|
|
|
|
Remove a layout container (with all its children) from hierarchy. |
|
|
Sample layoutContainer.remove(); |
|
|
|
|
Removes a component (JSLabel, JSButton, JSField, JSPortal, JSBean, JSTabpanel, JSWebComponent) that has the given name. It is the same as calling "if(!removeLabel(name) && !removeButton(name) ....)".
Returns true if removal was successful, false otherwise. |
|
|
Parameters the specified name of the component to be deleted |
|
|
|
|
Returns Boolean true if component has been successfully deleted; false otherwise |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var form = solutionModel.newForm('newFormX','db:/server1/parent_table',null,true,1000,750);
var jsbutton = form.newButton('JSButton to delete',100,100,200,50,null);
jsbutton.name = 'jsb';
var jslabel = form.newLabel('JSLabel to delete',100,200,200,50,null);
jslabel.name = 'jsl';
jslabel.transparent = false;
jslabel.background = 'green';
var jsfield = form.newField('scopes.globals.myGlobalVariable',JSField.TEXT_FIELD,100,300,200,50);
jsfield.name = 'jsf';
var relation = solutionModel.newRelation('parentToChild','db:/server1/parent_table','db:/server1/child_table',JSRelation.INNER_JOIN);
relation.newRelationItem('parent_table_id', '=', 'child_table_id');
var jsportal = form.newPortal('jsp',relation,100,400,300,300);
jsportal.newField('child_table_id',JSField.TEXT_FIELD,200,200,120);
var childOne = solutionModel.newForm('childOne','db:/server1/child_table',null,false,400,300);
childOne.newField('child_table_id', JSField.TEXT_FIELD,10,10,100,20);
var childTwo = solutionModel.newForm('childTwo','server1','other_table',null,false,400,300);
childTwo.newField('some_table_id', JSField.TEXT_FIELD,10,10,100,100);
var jstabpanel = form.newTabPanel('jst',450,30,620,460);
jstabpanel.newTab('tab1','Child One',childOne,relation);
jstabpanel.newTab('tab2','Child Two',childTwo);
var jsmethod = form.newMethod("function removeMe(event) { var form = solutionModel.getForm('newFormX');\n if ((form.removeComponent('jsb') == true) && (form.removeComponent('jsl') == true) && (form.removeComponent('jsf') == true) && (form.removeComponent('jsp') == true) & (form.removeComponent('jst') == true)) application.output('Components removed ok'); else application.output('Some component(s) could not be deleted'); forms['newFormX'].controller.recreateUI();}");
var removerButton = form.newButton('Click here to remove form components',450,500,250,50,jsmethod);
removerButton.name = 'remover';
forms['newFormX'].controller.show(); |
|
|
|
|
Removes a JSWebComponent that has the specified name. Returns true if removal was successful, false otherwise. |
|
|
Parameters the specified name of the JSWebComponent to be removed |
|
|
|
|
Returns Boolean true if the JSWebComponent has been removed; false otherwise |
|
|
Sample var form = solutionModel.getForm('myform');
form.removeWebComponent('mybean') |
|
|
|
|
|
|