SolutionModel
Last updated
Was this helpful?
Last updated
Was this helpful?
(solutionModel)
SolutionModel
provides runtime access to design-time objects in Servoy, enabling dynamic application modifications without recompilation. Developers can retrieve and modify forms, relations, media, and methods using methods like getForm(name)
, newForm(name)
, and getRelation(name)
. New components, forms, and relations can also be created or cloned dynamically.
Global methods and variables are managed with methods like newGlobalMethod(scopeName, code)
and newGlobalVariable(scopeName, name, type)
. Existing ones can be removed using corresponding remove
methods. Forms can be created with specific layouts and styles, made responsive, or reverted to their original configurations with revertForm(name)
.
The API supports argument wrapping for event handling with wrapMethodWithArguments(method, args)
and allows management of value lists, media, and relations.
,,,,,,,,,,,,,,,,,,
Makes an exact copy of the given component (JSComponent/JSField/JSLabel) and gives it a new name.
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.
Makes an exact copy of the given form and gives it the new name.
Gets an array of all relations.
Gets the specified data source node and returns information about the form (see JSDataSourceNode node).
Gets the specified form object and returns information about the form (see JSForm node).
Get an array of all forms.
Get an array of forms, that are all based on datasource/servername.
Get an array of forms, that are all based on datasource/servername and tablename.
Gets an existing global method by the specified name.
The list of all global methods.
The list of all global methods.
Gets an existing global variable by the specified name.
Gets an array of all global variables.
Gets an array of all global variables.
Gets the specified media object; can be assigned to a button/label.
Gets the list of all media objects.
Retrieves an element by its uuid.
Gets an existing relation by the specified name and returns a JSRelation Object.
Gets an array of all relations; or an array of all global relations if the specified table is NULL.
Gets an array of all relations; or an array of all global relations if the specified table is NULL.
Gets an array of all scope names used.
Gets an existing valuelist by the specified name and returns a JSValueList Object that can be assigned to a field.
Gets an array of all valuelists for the currently active solution.
Creates a new JSForm Object.
Create a responsive form:
Creates a new form with the given JSForm as its super form.
Creates a new form with the given JSForm as its super form.
Create a responsive form:
Creates a new JSForm Object.
Creates a new JSForm Object.
Creates a new global method with the specified code in a scope.
Creates a new global variable with the specified name and number type.
Creates a new media object that can be assigned to a label or a button.
Creates a new media object for things like a CSS or LESS file that can be set as the clients solution style.
Creates a new JSRelation Object with a specified name; includes the primary datasource, foreign datasource and the type of join for the new relation.
Creates a new valuelist with the specified name and number type.
Removes the specified form during the persistent connected client session.
Removes the specified global method.
Removes the specified global variable.
Removes the media item specified by name.
Removes the relation specified by name.
Removes the specified valuelist.
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.
Get a JSMethod instance with arguments to be assigned to an event.
Makes an exact copy of the given component (JSComponent/JSField/JSLabel) and gives it a new name.
Parameters
Sample
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
Sample
Makes an exact copy of the given form and gives it the new name.
Parameters
Sample
Gets an array of all relations.
Sample
Gets the specified data source node and returns information about the form (see JSDataSourceNode node). The JSDataSourceNode holds all calculations and foundset methods.
Parameters
Sample
Gets the specified form object and returns information about the form (see JSForm node).
Parameters
Sample
Get an array of all forms.
Sample
Get an array of forms, that are all based on datasource/servername.
Parameters
Sample
Get an array of forms, that are all based on datasource/servername and tablename.
Parameters
Sample
Gets an existing global method by the specified name.
Parameters
Sample
The list of all global methods.
Sample
The list of all global methods.
Parameters
Sample
Gets an existing global variable by the specified name.
Parameters
Sample
Gets an array of all global variables.
Sample
Gets an array of all global variables.
Parameters
Sample
Gets the specified media object; can be assigned to a button/label.
Parameters
Sample
Gets the list of all media objects.
Sample
Retrieves an element by its uuid.
Parameters
Sample
Gets an existing relation by the specified name and returns a JSRelation Object.
Parameters
Sample
Gets an array of all relations; or an array of all global relations if the specified table is NULL.
Parameters
Sample
Gets an array of all relations; or an array of all global relations if the specified table is NULL.
Parameters
Sample
Gets an array of all scope names used.
Sample
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
Sample
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.
Sample
Creates a new JSForm Object.
Parameters
Sample
Create a responsive form:
Parameters
Sample
Creates a new form with the given JSForm as its super form.
Parameters
Sample
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
Sample
Create a responsive form:
Parameters
Sample
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
Sample
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
Sample
Creates a new global method with the specified code in a scope.
Parameters
Sample
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
Sample
Creates a new media object that can be assigned to a label or a button.
Parameters
Sample
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
Sample
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
Sample
Creates a new valuelist with the specified name and number type.
Parameters
Sample
Removes the specified form during the persistent connected client session.
NOTE: Make sure you call history.remove first in your Servoy method (script).
Parameters
Sample
Removes the specified global method.
Parameters
Sample
Removes the specified global variable.
Parameters
Sample
Removes the media item specified by name.
Parameters
Sample
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
Sample
Removes the specified valuelist.
Parameters
Sample
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
Sample
Get a JSMethod instance with arguments to be assigned to an event.
Parameters
Sample
newName the new name of the cloned component
component the component to clone
Returns: the exact copy of the given component
newName the new name of the cloned component
component the component to clone
newParentForm the new parent form
Returns: the exact copy of the given component
newName the new name for the form clone
jsForm the form to be cloned
Returns: a JSForm
Returns: an array of all relations (all elements in the array are of type JSRelation)
dataSource table data source
Returns: a JSDataSourceNode
name the specified name of the form
Returns: a JSForm
Returns: an array of JSForm type elements
datasource the datasource or servername
Returns: an array of JSForm type elements
server the datasource or servername
tablename the tablename
Returns: an array of JSForm type elements
scopeName the scope in which the method is searched
name the name of the specified global method
Returns: a JSMethod
Returns: an array of JSMethod type elements
scopeName limit to global methods of specified scope name
Returns: an array of JSMethod type elements
scopeName the scope in which the variable is searched
name the specified name of the global variable
Returns: a JSVariable
Returns: an array of JSVariable type elements
scopeName limit to global vars of specified scope name
Returns: an array of JSVariable type elements
name the specified name of the media object
Returns: a JSMedia element
Returns: a list with all the media objects.
uuid element uuid
Returns: found element
name the specified name of the relation
Returns: a JSRelation
datasource the specified name of the datasource for the specified table
Returns: an array of all relations (all elements in the array are of type JSRelation)
servername the specified name of the server for the specified table
tablename the specified name of the table
Returns: an array of all relations (all elements in the array are of type JSRelation)
Returns: an array of String scope names
name the specified name of the valuelist
Returns: a JSValueList object
Returns: an array of JSValueList objects
name the specified name of the form
Returns: a new JSForm object
name The name of the new form, must be a valid javascript identifier
isResponsive if true will create an responsive form, otherwise an absolute layout form
Returns: a new JSForm object
name The name of the new form
superForm the super form that will extended from, see JSform.setExtendsForm();
Returns: a new JSForm object
name The name of the new form, must be a valid javascript identifier
superForm the super form that will extended from, see JSform.setExtendsForm();
isResponsive ;
Returns: a new JSForm object
name The name of the new form, must be a valid javascript identifier
dataSource the form datasource
isResponsive if true will create an responsive form, otherwise an absolute layout form
Returns: a new JSForm object
name the specified name of the form, must be a valid javascript identifier
dataSource the specified name of the datasource for the specified table
styleName the specified style
show_in_menu if true show the name of the new form in the menu; or false for not showing
width the width of the form in pixels
height the height of the form in pixels
Returns: a new JSForm object
name the specified name of the form
serverName the specified name of the server for the specified table
tableName the specified name of the table
styleName the specified style
show_in_menu if true show the name of the new form in the menu; or false for not showing
width the width of the form in pixels
height the height of the form in pixels
Returns: a new JSForm object
scopeName the scope in which the method is created
code the specified code for the global method
Returns: a JSMethod object
scopeName the scope in which the variable is created
name the specified name for the global variable
type the specified number type for the global variable
Returns: a JSVariable object
name The name of the new media
bytes The content
Returns: a JSMedia object
name The name of the new media
bytes The content
Returns: a JSMedia object
name the specified name of the new relation
primaryDataSource the specified name of the primary datasource
foreignDataSource the specified name of the foreign datasource
joinType the type of join for the new relation; JSRelation.INNER_JOIN, JSRelation.LEFT_OUTER_JOIN
Returns: a JSRelation object
name the specified name for the valuelist
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: a JSValueList object
name the specified name of the form to remove
Returns: true is form has been removed, false if form could not be removed
scopeName the scope in which the method is declared
name the name of the global method to be removed
Returns: true if the removal was successful, false otherwise
scopeName the scope in which the variable is declared
name the name of the global variable to be removed
Returns: true if the removal was successful, false otherwise
name the name of the media item to be removed
Returns: true if the removal was successful, false otherwise
name the name of the relation to be removed
Returns: true if the removal was successful, false otherwise
name name of the valuelist to be removed
Returns: true if the removal was successful, false otherwise
name the specified name of the form to revert
Returns: a JSForm object
method JSMethod to be assigned to an event
args positional arguments
Returns: a JSMethod