SolutionModel
(solutionModel)
Overview
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.
Returned Types
DEFAULTS,FONTSTYLE,SCROLLBAR,JSForm,JSDataSourceNode,JSCalculation,JSLayoutContainer,JSComponent,JSMethod,JSPart,JSRelation,JSRelationItem,JSMedia,JSValueList,JSVariable,JSPart,JSPart,JSComponent,
Methods Summarized
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.
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 forms, that are all based on datasource/servername and tablename.
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 existing valuelist by the specified name and returns a JSValueList Object that can be assigned to a field.
Creates a new form with the given JSForm as its super form.
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 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.