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

Type
Name
Summary

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.

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.