SolutionModel

(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

TypeNameSummary

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..

Create a bevel border string..

Create an empty border string..

Create an etched border string..

Create a font string..

Create a line border string..

Create a matte border string..

Create a page format string..

Create a page format string..

Create a page format string..

Create a special matte border string..

Create a special matte border string..

Create a titled border string..

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 the style specified by the given name..

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 style with the given css content string under the given name..

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 style..

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..

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

// get an existing field to clone.
var field = solutionModel.getForm("formWithField").getField("fieldName");
// make a clone/copy of the field
var clone = solutionModel.cloneComponent("clonedField",field);

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

// get an existing field to clone.
var field = solutionModel.getForm("formWithField").getField("fieldName");
// get the target form for the copied/cloned field
var form = solutionModel.getForm("targetForm");
// make a clone/copy of the field and re parent it to the target form.
var clone = solutionModel.cloneComponent("clonedField",field,form);
// show it
forms["targetForm"].controller.show();

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

// get an existing form
var form = solutionModel.getForm("existingForm")
// make a clone/copy from it
var clone = solutionModel.cloneForm("clonedForm", form)
// add a new label to the clone
clone.newLabel("added label",50,50,80,20);
// show it
forms["clonedForm"].controller.show();

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

var form = solutionModel.getForm("someForm");
form.borderType = solutionModel.createBevelBorder(SM_BEVELTYPE.RAISED,'#ff0000','#00ff00','#ff0000','#00ff00');

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

var form = solutionModel.getForm("someForm");
form.borderType = solutionModel.createEmptyBorder(1,1,1,1);

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

var form = solutionModel.getForm("someForm");
form.borderType = solutionModel.createEtchedBorder(SM_BEVELTYPE.RAISED,'#ff0000','#00ff00');

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

var form = solutionModel.getForm("someForm");
var component = form.getComponent("someComponent")
component.fontType = solutionModel.createFont('Arial',SM_FONTSTYLE.BOLD,14);

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

var form = solutionModel.getForm("someForm");
form.borderType = solutionModel.createLineBorder(1,'#ff0000');

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

var form = solutionModel.getForm("someForm");
form.borderType = solutionModel.createMatteBorder(1,1,1,1,"#00ff00");

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

var form = solutionModel.getForm("someForm");
form.defaultPageFormat = solutionModel.createPageFormat(612,792,72,72,72,72,SM_ORIENTATION.PORTRAIT,SM_UNITS.PIXELS);

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

var form = solutionModel.getForm("someForm");
form.defaultPageFormat = solutionModel.createPageFormat(612,792,72,72,72,72,SM_ORIENTATION.PORTRAIT,SM_UNITS.PIXELS);

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

var form = solutionModel.getForm("someForm");
form.defaultPageFormat = solutionModel.createPageFormat(612,792,72,72,72,72,SM_ORIENTATION.PORTRAIT,SM_UNITS.PIXELS);

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

var form = solutionModel.getForm("someForm");
// create a rectangle border (no rounded corners) and continous line
form.borderType = solutionModel.createSpecialMatteBorder(1,1,1,1,"#00ff00","#00ff00","#00ff00","#00ff00",0,null);
// create a border with rounded corners and dashed line (25 pixels drawn, then 25 pixels skipped)
// rounding_radius is an array of up to 8 numbers, order is: top-left,top-right,bottom-right,bottom-left (repetead twice - for width and height)
// form.borderType = solutionModel.createSpecialMatteBorder(1,1,1,1,"#00ff00","#00ff00","#00ff00","#00ff00",new Array(10,10,10,10),new Array(25,25));

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

var form = solutionModel.getForm("someForm");
// create a rectangle border (no rounded corners) and continous line
form.borderType = solutionModel.createSpecialMatteBorder(1,1,1,1,"#00ff00","#00ff00","#00ff00","#00ff00",0,null);
// create a border with rounded corners and dashed line (25 pixels drawn, then 25 pixels skipped)
// form.borderType = solutionModel.createSpecialMatteBorder(1,1,1,1,"#00ff00","#00ff00","#00ff00","#00ff00",10,new Array(25,25));

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

var form = solutionModel.getForm("someForm");
form.borderType = solutionModel.createTitledBorder('Test',solutionModel.createFont('Arial',SM_FONTSTYLE.PLAIN,10),'#ff0000',SM_TITLEJUSTIFICATION.CENTER,SM_TITLEPOSITION.TOP);

getAllRelations()

Gets an array of all relations.

Returns Array an array of all relations (all elements in the array are of type JSRelation)

Sample

var relations = solutionModel.getAllRelations();
if (relations.length != 0)
	for (var i in relations)
		application.output(relations[i].name);

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

var dsnode = solutionModel.getDataSourceNode('db:/example_data/customers');
var c = dsnode.getCalculation("myCalculation");
application.output("Name: " + c.getName() + ", Stored: " + c.isStored());

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

var myForm = solutionModel.getForm('existingFormName');
//get the style of the form (for all other properties see JSForm node)
var styleName = myForm.styleName;

getForms()

Get an array of all forms.

Returns Array an array of JSForm type elements

Sample

var forms = solutionModel.getForms()
for (var i in forms)
	application.output(forms[i].name)

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

var forms = solutionModel.getForms(datasource)
for (var i in forms)
	application.output(forms[i].name)

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

var forms = solutionModel.getForms(datasource,tablename)
for (var i in forms)
	application.output(forms[i].name)

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

var method = solutionModel.getGlobalMethod('globals', 'nameOfGlobalMethod');
if (method != null) application.output(method.code);

getGlobalMethods()

The list of all global methods.

Returns Array an array of JSMethod type elements

Sample

var methods = solutionModel.getGlobalMethods('globals');
for (var x in methods)
	application.output(methods[x].getName());

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

var methods = solutionModel.getGlobalMethods('globals');
for (var x in methods)
	application.output(methods[x].getName());

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

var globalVariable = solutionModel.getGlobalVariable('globals', 'globalVariableName');
application.output(globalVariable.name + " has the default value of " + globalVariable.defaultValue);

getGlobalVariables()

Gets an array of all global variables.

Returns Array an array of JSVariable type elements

Sample

var globalVariables = solutionModel.getGlobalVariables('globals');
for (var i in globalVariables)
	application.output(globalVariables[i].name + " has the default value of " + globalVariables[i].defaultValue);

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

var globalVariables = solutionModel.getGlobalVariables('globals');
for (var i in globalVariables)
	application.output(globalVariables[i].name + " has the default value of " + globalVariables[i].defaultValue);

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

var myMedia = solutionModel.getMedia('button01.gif')
//now set the imageMedia property of your label or button