SolutionModel
Return Types
ALIGNMENT,ANCHOR,BEVELTYPE,CURSOR,DEFAULTS,FONTSTYLE,MEDIAOPTION,PAGEORIENTATION,PRINTSLIDING,SCROLLBAR,TITLEJUSTIFICATION,TITLEPOSITION,UNITS,JSForm,JSDataSourceNode,JSComponent,JSComponent,JSCalculation,JSField,JSLayoutContainer,JSField,JSField,JSField,JSField,JSField,JSField,JSField,JSList,JSInsetList,JSComponent,JSComponent,JSMethod,JSComponent,JSPart,JSRelation,JSRelationItem,JSStyle,JSComponent,JSTab,JSMedia,JSValueList,JSVariable,JSPart,JSPart,JSTitle,JSComponent,
Methods Summary
Methods Details
cloneComponent(newName, component)
Makes an exact copy of the given component (JSComponent/JSField/JSLabel) and gives it a new name.
Parameters String newName the new name of the cloned component JSComponent component the component to clone
Returns JSComponent the exact copy of the given component
Sample
cloneComponent(newName, component, newParentForm)
Makes an exact copy of the given component (JSComponent/JSField/JSLabel), gives it a new name and moves it to a new parent form, specified as a parameter.
Parameters String newName the new name of the cloned component JSComponent component the component to clone JSForm newParentForm the new parent form
Returns JSComponent the exact copy of the given component
Sample
cloneForm(newName, jsForm)
Makes an exact copy of the given form and gives it the new name.
Parameters String newName the new name for the form clone JSForm jsForm the form to be cloned
Returns JSForm a JSForm
Sample
createBevelBorder(bevel_type, highlight_outer_color, highlight_inner_color, shadow_outer_color, shadow_inner_color)
Create a bevel border string.
Parameters Number bevel_type bevel border type (SM_BEVELTYPE.RAISED or SM_BEVELTYPE.LOWERED) String highlight_outer_color bevel border highlight outer color String highlight_inner_color bevel border highlight inner color String shadow_outer_color bevel border shadow outer color String shadow_inner_color bevel border shadow outer color
Returns String
Sample
createEmptyBorder(top_width, right_width, bottom_width, left_width)
Create an empty border string.
Parameters Number top_width top width of empty border in pixels Number right_width right width of empty border in pixels Number bottom_width bottom width of empty border in pixels Number left_width left width of empty border in pixels
Returns String
Sample
createEtchedBorder(bevel_type, highlight_color, shadow_color)
Create an etched border string.
Parameters Number bevel_type bevel border type String highlight_color bevel border highlight color String shadow_color bevel border shadow color
Returns String
Sample
createFont(name, style, size)
Create a font string.
Parameters String name the name of the font Number style the style of the font (PLAIN, BOLD, ITALIC or BOLD+ITALIC) Number size the font size
Returns String
Sample
createLineBorder(thick, color)
Create a line border string.
Parameters Number thick border thickness in pixels String color color of the line border
Returns String
Sample
createMatteBorder(top_width, right_width, bottom_width, left_width, color)
Create a matte border string.
Parameters Number top_width top width of matte border in pixels Number right_width right width of matte border in pixels Number bottom_width bottom width of matte border in pixels Number left_width left width of matte border in pixels String color border color
Returns String
Sample
createPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin)
Create a page format string.
Note: The unit specified for width, height and all margins MUST be the same.
Parameters Number width the specified width of the page to be printed. Number height the specified height of the page to be printed. Number leftmargin the specified left margin of the page to be printed. Number rightmargin the specified right margin of the page to be printed. Number topmargin the specified top margin of the page to be printed. Number bottommargin the specified bottom margin of the page to be printed.
Returns String
Sample
createPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin, orientation)
Create a page format string.
Note: The unit specified for width, height and all margins MUST be the same.
Parameters Number width the specified width of the page to be printed. Number height the specified height of the page to be printed. Number leftmargin the specified left margin of the page to be printed. Number rightmargin the specified right margin of the page to be printed. Number topmargin the specified top margin of the page to be printed. Number bottommargin the specified bottom margin of the page to be printed. Number orientation the specified orientation of the page to be printed; the default is Portrait mode
Returns String
Sample
createPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin, orientation, units)
Create a page format string.
Note: The unit specified for width, height and all margins MUST be the same.
Parameters Number width the specified width of the page to be printed. Number height the specified height of the page to be printed. Number leftmargin the specified left margin of the page to be printed. Number rightmargin the specified right margin of the page to be printed. Number topmargin the specified top margin of the page to be printed. Number bottommargin the specified bottom margin of the page to be printed. Number orientation the specified orientation of the page to be printed; the default is Portrait mode Number units the specified units for the width and height of the page to be printed; the default is pixels
Returns String
Sample
createRoundedBorder(top_width, right_width, bottom_width, left_width, top_color, right_color, bottom_color, left_color, rounding_radius, border_style)
Create a special matte border string.
Parameters Number top_width top width of matte border in pixels Number right_width right width of matte border in pixels Number bottom_width bottom width of matte border in pixels Number left_width left width of matte border in pixels String top_color top border color String right_color right border color String bottom_color bottom border color String left_color left border color Array rounding_radius array with width/height of the arc to round the corners Array border_style the border styles for the four margins(top/left/bottom/left)
Returns String
Sample
createSpecialMatteBorder(top_width, right_width, bottom_width, left_width, top_color, right_color, bottom_color, left_color, rounding_radius, dash_pattern)
Create a special matte border string.
Parameters Number top_width top width of matte border in pixels Number right_width right width of matte border in pixels Number bottom_width bottom width of matte border in pixels Number left_width left width of matte border in pixels String top_color top border color String right_color right border color String bottom_color bottom border color String left_color left border color Number rounding_radius width of the arc to round the corners Array dash_pattern the dash pattern of border stroke
Returns String
Sample
createTitledBorder(title_text, font, color, title_justification, title_position)
Create a titled border string.
Parameters String title_text the text from border String font title text font string String color border color Number title_justification title text justification Number title_position bevel title text position
Returns String
Sample
getAllRelations()
Gets an array of all relations.
Returns Array an array of all relations (all elements in the array are of type JSRelation)
Sample
getDataSourceNode(dataSource)
Gets the specified data source node and returns information about the form (see JSDataSourceNode node). The JSDataSourceNode holds all calculations and foundset methods.
Parameters String dataSource table data source
Returns JSDataSourceNode a JSDataSourceNode
Sample
getForm(name)
Gets the specified form object and returns information about the form (see JSForm node).
Parameters String name the specified name of the form
Returns JSForm a JSForm
Sample
getForms()
Get an array of all forms.
Returns Array an array of JSForm type elements
Sample
getForms(datasource)
Get an array of forms, that are all based on datasource/servername.
Parameters String datasource the datasource or servername
Returns Array an array of JSForm type elements
Sample
getForms(server, tablename)
Get an array of forms, that are all based on datasource/servername and tablename.
Parameters String server the datasource or servername String tablename the tablename
Returns Array an array of JSForm type elements
Sample
getGlobalMethod(scopeName, name)
Gets an existing global method by the specified name.
Parameters String scopeName the scope in which the method is searched String name the name of the specified global method
Returns JSMethod a JSMethod
Sample
getGlobalMethods()
The list of all global methods.
Returns Array an array of JSMethod type elements
Sample
getGlobalMethods(scopeName)
The list of all global methods.
Parameters String scopeName limit to global methods of specified scope name
Returns Array an array of JSMethod type elements
Sample
getGlobalVariable(scopeName, name)
Gets an existing global variable by the specified name.
Parameters String scopeName the scope in which the variable is searched String name the specified name of the global variable
Returns JSVariable a JSVariable
Sample
getGlobalVariables()
Gets an array of all global variables.
Returns Array an array of JSVariable type elements
Sample
getGlobalVariables(scopeName)
Gets an array of all global variables.
Parameters String scopeName limit to global vars of specified scope name
Returns Array an array of JSVariable type elements
Sample
getMedia(name)
Gets the specified media object; can be assigned to a button/label.
Parameters String name the specified name of the media object
Returns JSMedia a JSMedia element
Sample
getMediaList()
Gets the list of all media objects.
Returns Array a list with all the media objects.
Sample
getObjectByUUID(uuid)
Retrieves an element by its uuid.
Parameters Object uuid element uuid
Returns Object found element
Sample
getRelation(name)
Gets an existing relation by the specified name and returns a JSRelation Object.
Parameters String name the specified name of the relation
Returns JSRelation a JSRelation
Sample
getRelations(datasource)
Gets an array of all relations; or an array of all global relations if the specified table is NULL.
Parameters String datasource the specified name of the datasource for the specified table
Returns Array an array of all relations (all elements in the array are of type JSRelation)
Sample
getRelations(servername, tablename)
Gets an array of all relations; or an array of all global relations if the specified table is NULL.
Parameters String servername the specified name of the server for the specified table String tablename the specified name of the table
Returns Array an array of all relations (all elements in the array are of type JSRelation)
Sample
getScopeNames()
Gets an array of all scope names used.
Returns Array an array of String scope names
Sample
getStyle(name)
Gets the style specified by the given name.
Parameters String name the specified name of the style
Returns JSStyle a JSStyle
Sample
getValueList(name)
Gets an existing valuelist by the specified name and returns a JSValueList Object that can be assigned to a field.
NOTE: Changes to valuelist should be done before showing any form that has component using the valuelist.
Parameters String name the specified name of the valuelist
Returns JSValueList a JSValueList object
Sample
getValueLists()
Gets an array of all valuelists for the currently active solution.
NOTE: Changes to valuelist should be done before showing any form that has component using the valuelist.
Returns Array an array of JSValueList objects
Sample
newForm(name)
Creates a new JSForm Object.
Parameters String name the specified name of the form
Returns JSForm a new JSForm object
Sample
newForm(name, isResponsive)
Create a responsive form:
Parameters String name The name of the new form, must be a valid javascript identifier Boolean isResponsive if true will create an responsive form, otherwise an absolute layout form
Returns JSForm a new JSForm object
Sample
newForm(name, superForm)
Creates a new form with the given JSForm as its super form.
Parameters String name The name of the new form JSForm superForm the super form that will extended from, see JSform.setExtendsForm();
Returns JSForm a new JSForm object
Sample
newForm(name, superForm, isResponsive)
Creates a new form with the given JSForm as its super form. Use this function in the case when the super form is a logical form (no parts/UI).
Parameters String name The name of the new form, must be a valid javascript identifier JSForm superForm the super form that will extended from, see JSform.setExtendsForm(); Boolean isResponsive ;
Returns JSForm a new JSForm object
Sample
newForm(name, dataSource, isResponsive)
Create a responsive form:
Parameters String name The name of the new form, must be a valid javascript identifier String dataSource the form datasource Boolean isResponsive if true will create an responsive form, otherwise an absolute layout form
Returns JSForm a new JSForm object
Sample
newForm(name, dataSource, styleName, show_in_menu, width, height)
Creates a new JSForm Object.
NOTE: See the JSForm node for more information about form objects that can be added to the new form.
Parameters String name the specified name of the form, must be a valid javascript identifier String dataSource the specified name of the datasource for the specified table String styleName the specified style Boolean show_in_menu if true show the name of the new form in the menu; or false for not showing Number width the width of the form in pixels Number height the height of the form in pixels
Returns JSForm a new JSForm object
Sample
newForm(name, serverName, tableName, styleName, show_in_menu, width, height)
Creates a new JSForm Object.
NOTE: See the JSForm node for more information about form objects that can be added to the new form.
Parameters String name the specified name of the form String serverName the specified name of the server for the specified table String tableName the specified name of the table String styleName the specified style Boolean show_in_menu if true show the name of the new form in the menu; or false for not showing Number width the width of the form in pixels Number height the height of the form in pixels
Returns JSForm a new JSForm object
Sample
newGlobalMethod(scopeName, code)
Creates a new global method with the specified code in a scope.
Parameters String scopeName the scope in which the method is created String code the specified code for the global method
Returns JSMethod a JSMethod object
Sample
newGlobalVariable(scopeName, name, type)
Creates a new global variable with the specified name and number type.
NOTE: The global variable number type is based on the value assigned from the SolutionModel-JSVariable node; for example: JSVariable.INTEGER.
Parameters String scopeName the scope in which the variable is created String name the specified name for the global variable Number type the specified number type for the global variable
Returns JSVariable a JSVariable object
Sample
newMedia(name, bytes)
Creates a new media object that can be assigned to a label or a button.
Parameters String name The name of the new media Array bytes The content
Returns JSMedia a JSMedia object
Sample
newMedia(name, bytes)
Creates a new media object for things like a CSS or LESS file that can be set as the clients solution style. The stringContents is converted to bytes through the UTF-8 charset.
Parameters String name The name of the new media Object bytes The content
Returns JSMedia a JSMedia object
Sample
newRelation(name, primaryDataSource, foreignDataSource, joinType)
Creates a new JSRelation Object with a specified name; includes the primary datasource, foreign datasource and the type of join for the new relation.
Parameters String name the specified name of the new relation String primaryDataSource the specified name of the primary datasource String foreignDataSource the specified name of the foreign datasource Number joinType the type of join for the new relation; JSRelation.INNER_JOIN, JSRelation.LEFT_OUTER_JOIN
Returns JSRelation a JSRelation object
Sample
newStyle(name, content)
Creates a new style with the given css content string under the given name.
NOTE: Will throw an exception if a style with that name already exists.
Parameters String name the name of the new style String content the css content of the new style
Returns JSStyle a JSStyle object
Sample
newValueList(name, type)
Creates a new valuelist with the specified name and number type.
Parameters String name the specified name for the valuelist Number type the specified number type for the valuelist; may be JSValueList.CUSTOM_VALUES, JSValueList.DATABASE_VALUES, JSValueList.EMPTY_VALUE_ALWAYS, JSValueList.EMPTY_VALUE_NEVER
Returns JSValueList a JSValueList object
Sample
removeForm(name)
Removes the specified form during the persistent connected client session.
NOTE: Make sure you call history.remove first in your Servoy method (script).
Parameters String name the specified name of the form to remove
Returns Boolean true is form has been removed, false if form could not be removed
Sample
removeGlobalMethod(scopeName, name)
Removes the specified global method.
Parameters String scopeName the scope in which the method is declared String name the name of the global method to be removed
Returns Boolean true if the removal was successful, false otherwise
Sample
removeGlobalVariable(scopeName, name)
Removes the specified global variable.
Parameters String scopeName the scope in which the variable is declared String name the name of the global variable to be removed
Returns Boolean true if the removal was successful, false otherwise
Sample
removeMedia(name)
Removes the media item specified by name.
Parameters String name the name of the media item to be removed
Returns Boolean true if the removal was successful, false otherwise
Sample
removeRelation(name)
Removes the relation specified by name. You cannot remove the relation if it is touched within the application. So even if you remove all the ui elements using it, like tabs, it still can't be removed, because of underlying created and cached data.
Parameters String name the name of the relation to be removed
Returns Boolean true if the removal was successful, false otherwise
Sample
removeStyle(name)
Removes the specified style.
Parameters String name the name of the style to be removed
Returns Boolean true if the removal was successful, false otherwise
Sample
removeValueList(name)
Removes the specified valuelist.
Parameters String name name of the valuelist to be removed
Returns Boolean true if the removal was successful, false otherwise
Sample
revertForm(name)
Reverts the specified form to the original (blueprint) version of the form; will result in an exception error if the form is not an original form.
NOTE: Make sure you call history.remove first in your Servoy method (script) or call form.controller.recreateUI() before the script ends.
Parameters String name the specified name of the form to revert
Returns JSForm a JSForm object
Sample
wrapMethodWithArguments(method, args)
Get a JSMethod instance with arguments to be assigned to an event.
Parameters JSMethod method JSMethod to be assigned to an event Array args positional arguments
Returns JSMethod a JSMethod
Sample
Last updated