Child pages
  • controller

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Hidden
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE


HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#enabled
Gets or sets the enabled state of a form; also known as "grayed-out".
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)

#readOnly
Gets or sets the read-only state of a form; also known as "editable"

Note: The field(s) in a form set as read-only can be selected and the field data can be copied to clipboard.

Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#view
Get/Set the current type of view of this form.

HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#deleteAllRecords()
Deletes all records in foundset, resulting in empty foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#deleteRecord()
Delete current selected record, deletes mulitple selected records incase the foundset is using multiselect.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#duplicateRecord([location])
Duplicate current record or record at index in the form foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#find()
Set the foundset in find mode.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#focusField(fieldName, skipReadonly)
Sets focus to a field specified by its name.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#focusFirstField()
Sets focus to the first field of the form; based on tab order sequence.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getDataProviderMaxLength(name)
Returns the maximum length allowed in the specified dataprovider.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
#getDataProviderValue(dataProvider)
Gets a value based on the specified dataprovider name.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getDataSource()
Get the used datasource.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#getDesignMode()
Returns the state of this form designmode.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#getFormContext()
Gets the forms context where it resides, returns a dataset of its structure to the main controller.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getFormWidth()
Gets the form width in pixels.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getMaxRecordIndex()
Returns the current cached record count of the current foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getName()
Get the name of this form.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getPartHeight(partType)
Gets the part height in pixels.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getPartYOffset(partType)
Returns the Y offset of a given part of the form.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getSelectedIndex()
Gets the current record index of the current foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
#getTabSequence()
Get an array with the names of the components that are part of the tab sequence.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSWindow
Table Cell (td)
#getWindow()
Returns the JSWindow that the form is shown in, or null if the form is not currently showing in a window.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#invertRecords()
Inverts the current foundset against all rows of the current table; all records that are not in the foundset will become the current foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#loadAllRecords()
Loads all accessible records from the datasource into the form foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#loadOmittedRecords()
Loads the records that are currently omitted in the form foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#loadRecords([data], [queryArgumentsArray])
Load records via a (related) foundset, primary key (dataset/number/uuid) or query into the form.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#newRecord([location])
Create a new record in the form foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#omitRecord()
Omit current record in form foundset, to be shown with loadOmittedRecords.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#print([printCurrentRecordOnly], [showPrinterSelectDialog], [printerJob])
Print this form with current foundset, without preview.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#printXML([printCurrentRecordOnly])
Print this form with current foundset records to xml format.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#recreateUI()
Recreates the forms UI components, to reflect the latest solution model.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#relookup()
Performs a relookup for the current foundset record dataproviders.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#search([clearLastResults], [reduceSearch])
Start the database search and use the results, returns the number of records, make sure you did "find" function first.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setDataProviderValue(dataprovider, value)
Sets the value based on a specified dataprovider name.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setDesignMode(designMode)
Sets this form in designmode with param true, false will return to normal browse/edit mode.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setDesignMode(ondrag, ondrop, onselect, onresize)
Sets this form in designmode with one or more callback methods.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin, [orientation], [units])
Set the page format to use when printing.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setPreferredPrinter(printerName)
Set the preferred printer name to use when printing.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setSelectedIndex(index)
Sets the current record index of the current foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setTabSequence(arrayOfElements)
Set the tab order sequence programatically, by passing the elements references in a javascript array.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#show([window])
Shows the form (makes the form visible), optionally showing it in the specified JSWindow.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#showPrintPreview([printCurrentRecordOnly], [printerJob], [zoomFactor])
Show this form in print preview.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#showRecords(data, [window])
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#sort(sortString, [defer])
Sorts the form foundset based on the given sort string.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#sortDialog([sortString])
Show the sort dialog to the user a preselection sortString can be passed, to sort the form foundset.

HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idenabled
classnode
Table Row (tr)
idname
Table Cell (td)
enabled
Table Row (tr)
iddes
Table Cell (td)

Gets or sets the enabled state of a form; also known as "grayed-out".

Notes:
-A disabled element(s) cannot be selected by clicking the form.
-The disabled "grayed" color is dependent on the LAF set in the Servoy Smart Client Application Preferences.

Table Row (tr)
idret
Table Cell (td)
Returns
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//gets the enabled state of the form
var state = forms.customer.controller.enabled;
//enables the form for input
forms.customer.controller.enabled = true;
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idreadOnly
classnode
Table Row (tr)
idname
Table Cell (td)
readOnly
Table Row (tr)
iddes
Table Cell (td)

Gets or sets the read-only state of a form; also known as "editable"

Note: The field(s) in a form set as read-only can be selected and the field data can be copied to clipboard.

Table Row (tr)
idret
Table Cell (td)
Returns
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//gets the read-only state of the form
var state = forms.customer.controller.readOnly;
//sets the read-only state of the form
forms.customer.controller.readOnly = true
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idview
classnode
Table Row (tr)
idname
Table Cell (td)
view
Table Row (tr)
iddes
Table Cell (td)
Get/Set the current type of view of this form.
Table Row (tr)
idret
Table Cell (td)
Returns
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//gets the type of view for this form
var view = forms.customer.controller.view;
//sets the form to Record view
forms.customer.controller.view = 0;//RECORD_VIEW
//sets the form to List view
forms.customer.controller.view = 1;//LIST_VIEW
Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
iddeleteAllRecords
classnode
Table Row (tr)
idname
Table Cell (td)
deleteAllRecords
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
deleteAllRecords
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Deletes all records in foundset, resulting in empty foundset.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – false incase of related foundset having records and orphans records are not allowed by the relation
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.controller.deleteAllRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
iddeleteRecord
classnode
Table Row (tr)
idname
Table Cell (td)
deleteRecord
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
deleteRecord
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Delete current selected record, deletes mulitple selected records incase the foundset is using multiselect.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – false incase of related foundset having records and orphans records are not allowed by the relation
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.controller.deleteRecord();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idduplicateRecord
classnode
Table Row (tr)
idname
Table Cell (td)
duplicateRecord
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
duplicateRecord
Span
stylefloat: left;
idiets
([location])
Table Row (tr)
iddes
Table Cell (td)
Duplicate current record or record at index in the form foundset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Boolean} [location] – true adds the new record as the topmost record, or adds at specified index
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if succesful
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.duplicateRecord(); //duplicate the current record, adds on top
//forms.customer.controller.duplicateRecord(false); //duplicate the current record, adds at bottom
//forms.customer.controller.duplicateRecord(1,2); //duplicate the first record as second record
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idfind
classnode
Table Row (tr)
idname
Table Cell (td)
find
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
find
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)

Set the foundset in find mode. (Start a find request), use the "search" function to perform/exit the find.

Before going into find mode, all unsaved records will be saved in the database.
If this fails (due to validation failures or sql errors) or is not allowed (autosave off), the foundset will not go into find mode.
Make sure the operator and the data (value) are part of the string passed to dataprovider (included inside a pair of quotation marks).
Note: always make sure to check the result of the find() method.

When in find mode, columns can be assigned string expressions (including operators) that are evaluated as:
General:
c1||c2 (condition1 or condition2)
c|format (apply format on condition like 'x|dd-MM-yyyy')
!c (not condition)
#c (modify condition, depends on column type)
^ (is null)
^= (is null or empty)
<x (less than value x)
>x (greater than value x)
<=x (less than or equals value x)
>=x (greater than or equals value x)
x...y (between values x and y, including values)
x (equals value x)

Number fields:
=x (equals value x)
^= (is null or zero)

Date fields:
#c (equals value x, entire day)
now (equals now, date and or time)
// (equals today)
today (equals today)

Text fields:
#c (case insensitive condition)
= x (equals a space and 'x')
^= (is null or empty)
%x% (contains 'x')
%x_y% (contains 'x' followed by any char and 'y')
% (contains char '%')
_ (contains char '_')

Related columns can be assigned, they will result in related searches.
For example, "employees_to_department.location_id = headoffice" finds all employees in the specified location).

Searching on related aggregates is supported.
For example, "orders_to_details.total_amount = '>1000'" finds all orders with total order details amount more than 1000.

Arrays can be used for searching a number of values, this will result in an 'IN' condition that will be used in the search.
The values are not restricted to strings but can be any type that matches the column type.
For example, "record.department_id = [1, 33, 99]"

Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if the foundset is now in find mode, false otherwise.
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
.search
databaseManager.setAutoSave
controller.find
controller.search
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
if (forms.customer.foundset.find()) //find will fail if autosave is disabled and there are unsaved records
{
	columnTextDataProvider = 'a search value'
 // for numbers you have to make sure to format it correctly so that the decimal point is in your locales notation (. or ,)
	columnNumberDataProvider = '>' + utils.numberFormat(anumber, '####.00');
	columnDateDataProvider = '31-12-2010|dd-MM-yyyy'
	forms.customer.foundset.search()
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idfocusField
classnode
Table Row (tr)
idname
Table Cell (td)
focusField
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
focusField
Span
stylefloat: left;
idiets
(fieldName, skipReadonly)
Table Row (tr)
iddes
Table Cell (td)
Sets focus to a field specified by its name.
If the second parameter is set to true, then readonly fields will be skipped
(the focus will be set to the first non-readonly field located after the field with the specified name; the tab sequence is respected when searching for the non-readonly field).
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} fieldName – the name of the field to be focussed
{Boolean} skipReadonly – indication to skip read only fields, if the named field happens to be read only
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var tabseq = forms.customer.controller.getTabSequence();
if (tabseq.length > 1) {
	// If there is more than one field in the tab sequence, 
	// focus the second one and skip over readonly fields.
	forms.customer.controller.focusField(tabseq[1], true);
}
else {
	// If there is at most one field in the tab sequence, then focus
	// whatever field is first, and don't bother to skip over readonly fields.
	forms.customer.controller.focusField(null, false);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idfocusFirstField
classnode
Table Row (tr)
idname
Table Cell (td)
focusFirstField
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
focusFirstField
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Sets focus to the first field of the form; based on tab order sequence.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
controller.focusField
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.focusFirstField();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataProviderMaxLength
classnode
Table Row (tr)
idname
Table Cell (td)
getDataProviderMaxLength
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getDataProviderMaxLength
Span
stylefloat: left;
idiets
(name)
Table Row (tr)
iddes
Table Cell (td)
Returns the maximum length allowed in the specified dataprovider.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} name – the dataprovider name
Table Row (tr)
idret
Table Cell (td)
Returns
Number – the length
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.getDataProviderMaxLength('name');
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataProviderValue
classnode
Table Row (tr)
idname
Table Cell (td)
getDataProviderValue
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Object
Span
stylefloat: left; font-weight: bold;
idiets
getDataProviderValue
Span
stylefloat: left;
idiets
(dataProvider)
Table Row (tr)
iddes
Table Cell (td)
Gets a value based on the specified dataprovider name.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} dataProvider – the dataprovider name to retieve the value for
Table Row (tr)
idret
Table Cell (td)
Returns
Object – the dataprovider value (null if unknown dataprovider)
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var val = forms.customer.controller.getDataProviderValue('contact_name');
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataSource
classnode
Table Row (tr)
idname
Table Cell (td)
getDataSource
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
getDataSource
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Get the used datasource.
Table Row (tr)
idret
Table Cell (td)
Returns
String – the datasource
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var dataSource = forms.customer.controller.getDataSource();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDesignMode
classnode
Table Row (tr)
idname
Table Cell (td)
getDesignMode
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
getDesignMode
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Returns the state of this form designmode.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – the design mode state (true/fase)
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.controller.getDesignMode();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetFormContext
classnode
Table Row (tr)
idname
Table Cell (td)
getFormContext
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
JSDataSet
Span
stylefloat: left; font-weight: bold;
idiets
getFormContext
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Gets the forms context where it resides, returns a dataset of its structure to the main controller.
Note: can't be called in onload, because no context is yet available at this time.
Table Row (tr)
idret
Table Cell (td)
Returns
JSDataSet – the dataset with form context
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var dataset = forms.customer.controller.getFormContext();
if (dataset.getMaxRowIndex() > 1) 
{
	// form is in a tabpanel
	//dataset columns: [containername(1),formname(2),tabpanel or beanname(3),tabname(4),tabindex(5)]
	//dataset rows: mainform(1) -> parent(2)  -> current form(3) (when 3 forms deep)
	var parentFormName = dataset.getValue(1,2)
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetFormWidth
classnode
Table Row (tr)
idname
Table Cell (td)
getFormWidth
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getFormWidth
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Gets the form width in pixels.
Table Row (tr)
idret
Table Cell (td)
Returns
Number – the width in pixels
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var width = forms.customer.controller.getFormWidth();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetMaxRecordIndex
classnode
Table Row (tr)
idname
Table Cell (td)
getMaxRecordIndex
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getMaxRecordIndex
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Returns the current cached record count of the current foundset.
To return the full foundset count, use: databaseManager.getFoundSetCount(...)
Tip: get the the table count of all rows in a table, use: databaseManager.getTableCount(...)
Table Row (tr)
idret
Table Cell (td)
Returns
Number – the max record index
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
databaseManager.getFoundSetCount
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
for ( var i = 1 ; i <= forms.customer.controller.getMaxRecordIndex() ; i++ )
{
	forms.customer.controller.setSelectedIndex(i);
	//do some action per record
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetName
classnode
Table Row (tr)
idname
Table Cell (td)
getName
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
getName
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Get the name of this form.
Table Row (tr)
idret
Table Cell (td)
Returns
String – the name
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var formName = forms.customer.controller.getName();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetPartHeight
classnode
Table Row (tr)
idname
Table Cell (td)
getPartHeight
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getPartHeight
Span
stylefloat: left;
idiets
(partType)
Table Row (tr)
iddes
Table Cell (td)
Gets the part height in pixels.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} partType – The type of the part whose height will be returned.
Table Row (tr)
idret
Table Cell (td)
Returns
Number – the part height in pixels
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var height = forms.customer.controller.getPartHeight(JSPart.BODY);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetPartYOffset
classnode
Table Row (tr)
idname
Table Cell (td)
getPartYOffset
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getPartYOffset
Span
stylefloat: left;
idiets
(partType)
Table Row (tr)
iddes
Table Cell (td)
Returns the Y offset of a given part of the form.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} partType – The type of the part whose Y offset will be returned.
Table Row (tr)
idret
Table Cell (td)
Returns
Number – A number holding the Y offset of the specified form part.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var offset = forms.customer.controller.getPartYOffset(JSPart.BODY);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetSelectedIndex
classnode
Table Row (tr)
idname
Table Cell (td)
getSelectedIndex
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getSelectedIndex
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Gets the current record index of the current foundset.
Table Row (tr)
idret
Table Cell (td)
Returns
Number – the index
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//gets the current record index in the current foundset
var current = forms.customer.controller.getSelectedIndex();
//sets the next record in the foundset, will be reflected in UI
forms.customer.controller.setSelectedIndex(current+1);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetTabSequence
classnode
Table Row (tr)
idname
Table Cell (td)
getTabSequence
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String[]
Span
stylefloat: left; font-weight: bold;
idiets
getTabSequence
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Get an array with the names of the components that are part of the tab sequence.
The order of the names respects the order of the tab sequence.
Components that are not named will not appear in the returned array, although they may be in the tab sequence.
Table Row (tr)
idret
Table Cell (td)
Returns
String[] – array of names
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var tabseq = forms.customer.controller.getTabSequence();
if (tabseq.length > 1) {
	// If there is more than one field in the tab sequence, 
	// focus the second one and skip over readonly fields.
	forms.customer.controller.focusField(tabseq[1], true);
}
else {
	// If there is at most one field in the tab sequence, then focus
	// whatever field is first, and don't bother to skip over readonly fields.
	forms.customer.controller.focusField(null, false);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetWindow
classnode
Table Row (tr)
idname
Table Cell (td)
getWindow
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
JSWindow
Span
stylefloat: left; font-weight: bold;
idiets
getWindow
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Returns the JSWindow that the form is shown in, or null if the form is not currently showing in a window.
Table Row (tr)
idret
Table Cell (td)
Returns
JSWindow – the JSWindow that the form is shown in, or null if the form is not currently showing in a window.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var currentWindow = controller.getWindow();
if (currentWindow != null) {
		currentWindow.title = 'We have a new title';
} else {
		currentWindow = application.createWindow("Window Name", JSWindow.WINDOW, null);
		currentWindow(650, 700, 450, 350);
		currentWindow = "Window Title";
		controller.show(currentWindow);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idinvertRecords
classnode
Table Row (tr)
idname
Table Cell (td)
invertRecords
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
invertRecords
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Inverts the current foundset against all rows of the current table; all records that are not in the foundset will become the current foundset.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if successful
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.invertRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idloadAllRecords
classnode
Table Row (tr)
idname
Table Cell (td)
loadAllRecords
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
loadAllRecords
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)

Loads all accessible records from the datasource into the form foundset.
When the form contains a related foundset it will be replaced by a default foundset on same datasource.

Notes:
-the default foundset is always limited by filters, if databaseManager.addFoundSetFilterParam function is used.
-typical use is loading the normal foundset again after form usage in a related tabpanel

Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if successful
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
databaseManager.addTableFilterParam
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.loadAllRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idloadOmittedRecords
classnode
Table Row (tr)
idname
Table Cell (td)
loadOmittedRecords
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
loadOmittedRecords
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Loads the records that are currently omitted in the form foundset.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if successful
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.loadOmittedRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idloadRecords
classnode
Table Row (tr)
idname
Table Cell (td)
loadRecords
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
loadRecords
Span
stylefloat: left;
idiets
([data], [queryArgumentsArray])
Table Row (tr)
iddes
Table Cell (td)

Load records via a (related) foundset, primary key (dataset/number/uuid) or query into the form.

Load records can be used in 5 different ways
1) to load a (related)foundset into the form.
the form will no longer share the default foundset with forms of the same datasource, use loadAllRecords to restore the default foundset
controller.loadRecords(order_to_orderdetails);

2) to load a primary key dataset, will remove related sort!
var dataset = databaseManager.getDataSetByQuery(...);
controller.loadRecords(dataset);

3) to load a single record by primary key, will remove related sort! (pk should be a number or UUID)
controller.loadRecords(123);
or
controller.loadRecords(application.getUUID('6b5e2f5d-047e-45b3-80ee-3a32267b1f20'));

4) to reload all last related records again, if for example after a search in related tabpanel
controller.loadRecords();

5) to load records in to the form based on a query (also known as 'Form by query')
controller.loadRecords(sqlstring,parameters);
limitations/requirements for sqlstring are:
-must start with 'select'
-the selected columns must be the (Servoy Form) table primary key columns (alphabetically ordered like 'select a_id, b_id,c_id ...')
-can contain '?' which are replaced with values from the array supplied to parameters argument
if the sqlstring contains an 'order by' clause, the records will be sorted accordingly and additional constraints apply:
-must contain 'from' keyword
-the 'from' must be a comma separated list of table names
-must at least select from the table used in Servoy Form
-cannot contain 'group by', 'having' or 'union'
-all columns must be fully qualified like 'orders.order_id'

Table Row (tr)
idprs
Table Cell (td)
Parameters
[data] – the foundset/pkdataset/singlenNmber_pk/UUIDpk/queryString to load
[queryArgumentsArray] – the arguments to replace the questions marks in the queryString
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if successful
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
.loadRecords
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//Load records can be used in 5 different ways
//1) to load a (related)foundset into the form.
//the form will no longer share the default foundset with forms of the same datasource, use loadAllRecords to restore the default foundset 
//forms.customer.controller.loadRecords(order_to_orderdetails);

//2) to load a primary key dataset, will remove related sort!
//var dataset = databaseManager.getDataSetByQuery(...);
// dataset must match the table primary key columns (alphabetically ordered)
//forms.customer.controller.loadRecords(dataset);

//3) to load a single record by primary key, will remove related sort! (pk should be a number or UUID)
//forms.customer.controller.loadRecords(123);
//forms.customer.controller.loadRecords(application.getUUID('6b5e2f5d-047e-45b3-80ee-3a32267b1f20'));

//4) to reload all last related records again, if for example after a search in related tabpanel
//forms.customer.controller.loadRecords();

//5) to load records in to the form based on a query (also known as 'Form by query')
//forms.customer.controller.loadRecords(sqlstring,parameters);
//limitations/requirements for sqlstring are:
//-must start with 'select'
//-the selected columns must be the (Servoy Form) table primary key columns (alphabetically ordered like 'select a_id, b_id,c_id ...')
//-can contain '?' which are replaced with values from the array supplied to parameters argument
// if the sqlstring contains an 'order by' clause, the records will be sorted accordingly and additional constraints apply:
//-must contain 'from' keyword
//-the 'from' must be a comma separated list of table names
//-must at least select from the table used in Servoy Form
//-cannot contain 'group by', 'having' or 'union'
//-all columns must be fully qualified like 'orders.order_id'
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idnewRecord
classnode
Table Row (tr)
idname
Table Cell (td)
newRecord
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
newRecord
Span
stylefloat: left;
idiets
([location])
Table Row (tr)
iddes
Table Cell (td)
Create a new record in the form foundset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Boolean} [location] – true adds the new record as the topmost record, or adds at specified index
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if succesful
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// foreign key data is only filled in for equals (=) relation items 
forms.customer.controller.newRecord();//default adds on top
//forms.customer.controller.newRecord(false); //adds at bottom
//forms.customer.controller.newRecord(2); //adds as second record
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idomitRecord
classnode
Table Row (tr)
idname
Table Cell (td)
omitRecord
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
omitRecord
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)

Omit current record in form foundset, to be shown with loadOmittedRecords.

Note: The omitted records are discarded when these functions are executed: loadAllRecords, loadRecords(dataset), loadRecords(sqlstring), invert

Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if successful
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
controller.loadOmittedRecords
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.controller.omitRecord();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idprint
classnode
Table Row (tr)
idname
Table Cell (td)
print
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
print
Span
stylefloat: left;
idiets
([printCurrentRecordOnly], [showPrinterSelectDialog], [printerJob])
Table Row (tr)
iddes
Table Cell (td)
Print this form with current foundset, without preview.
Table Row (tr)
idprs
Table Cell (td)
Parameters
[printCurrentRecordOnly] – to print the current record only
{Boolean} [showPrinterSelectDialog] – to show the printer select dialog (default printer is normally used)
[printerJob] – print to plugin printer job, see pdf printer plugin for example
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//print this form (with foundset records)
forms.customer.controller.print();
//print only current record (no printerSelectDialog) to pdf plugin printer
//forms.customer.controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idprintXML
classnode
Table Row (tr)
idname
Table Cell (td)
printXML
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
printXML
Span
stylefloat: left;
idiets
([printCurrentRecordOnly])
Table Row (tr)
iddes
Table Cell (td)
Print this form with current foundset records to xml format.
Table Row (tr)
idprs
Table Cell (td)
Parameters
[printCurrentRecordOnly] – to print the current record only
Table Row (tr)
idret
Table Cell (td)
Returns
String – the XML
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//TIP: see also plugins.file.writeXMLFile(...)
var xml = forms.customer.controller.printXML();
//print only current record 
//var xml = forms.customer.controller.printXML(true);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idrecreateUI
classnode
Table Row (tr)
idname
Table Cell (td)
recreateUI
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
recreateUI
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Recreates the forms UI components, to reflect the latest solution model.
Use this after altering the elements via solutionModel at the JSForm of this form.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if successful
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// get the solution model JSForm 
var form = solutionModel.getForm("myForm");
// get the JSField of the form 
var field = form.getField("myField");
// alter the field
field.x = field.x + 10;
// recreate the runtime forms ui to reflect the changes.
forms.customer.controller.recreateUI();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idrelookup
classnode
Table Row (tr)
idname
Table Cell (td)
relookup
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
relookup
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Performs a relookup for the current foundset record dataproviders.
Lookups are defined in the dataprovider (columns) auto-enter setting and are normally performed over a relation upon record creation.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.relookup();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsearch
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
search
Span
stylefloat: left;
idiets
([clearLastResults], [reduceSearch])
Table Row (tr)
iddes
Table Cell (td)

Start the database search and use the results, returns the number of records, make sure you did "find" function first.

Note: Omitted records are automatically excluded when performing a search - meaning that the foundset result by default will not include omitted records.

Table Row (tr)
idprs
Table Cell (td)
Parameters
[clearLastResults] – boolean, clear previous search, default true
[reduceSearch] – boolean, reduce (true) or extend (false) previous search results, default true
Table Row (tr)
idret
Table Cell (td)
Returns
Number – the recordCount
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
.find
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var recordCount = forms.customer.foundset.search();
//var recordCount = forms.customer.foundset.search(false,false); //to extend foundset
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetDataProviderValue
classnode
Table Row (tr)
idname
Table Cell (td)
setDataProviderValue
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setDataProviderValue
Span
stylefloat: left;
idiets
(dataprovider, value)
Table Row (tr)
iddes
Table Cell (td)
Sets the value based on a specified dataprovider name.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} dataprovider – the dataprovider name to set the value for
{Object} value – the value to set in the dataprovider
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.setDataProviderValue('contact_name','mycompany');
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetDesignMode-Boolean
classnode
Table Row (tr)
idname
Table Cell (td)
setDesignMode
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setDesignMode
Span
stylefloat: left;
idiets
(designMode)
Table Row (tr)
iddes
Table Cell (td)
Sets this form in designmode with param true, false will return to normal browse/edit mode.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Boolean} designMode – sets form in design mode if true, false ends design mode.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//Set the current form in designmode with no callbacks
forms.customer.controller.setDesignMode(true);

//Set the current form out of designmode (to normal browse)
forms.customer.controller.setDesignMode(false);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetDesignMode-Function_Function_Function_Function
classnode
Table Row (tr)
idname
Table Cell (td)
setDesignMode
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setDesignMode
Span
stylefloat: left;
idiets
(ondrag, ondrop, onselect, onresize)
Table Row (tr)
iddes
Table Cell (td)
Sets this form in designmode with one or more callback methods.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Function} ondrag – onDrag method reference
{Function} ondrop – onDrop method reference
{Function} onselect – onSelect method reference
{Function} onresize – onResize method reference
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//Set the current form in designmode with callbacks
forms.customer.controller.setDesignMode(onDragMethod,onDropMethod,onSelectMethod,onResizeMethod);

//Set the current form out of designmode (to normal browse mode)
forms.customer.controller.setDesignMode(false);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetPageFormat
classnode
Table Row (tr)
idname
Table Cell (td)
setPageFormat
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setPageFormat
Span
stylefloat: left;
idiets
(width, height, leftmargin, rightmargin, topmargin, bottommargin, [orientation], [units])
Table Row (tr)
iddes
Table Cell (td)

Set the page format to use when printing.

Orientation values:
0 - Landscape mode
1 - Portrait mode

Units values:
0 - millimeters
1 - inches
2 - pixels

Note: The unit specified for width, height and all margins MUST be the same.

Table Row (tr)
idprs
Table Cell (td)
Parameters
width – the specified width of the page to be printed.
height – the specified height of the page to be printed.
leftmargin – the specified left margin of the page to be printed.
rightmargin – the specified right margin of the page to be printed.
topmargin – the specified top margin of the page to be printed.
bottommargin – the specified bottom margin of the page to be printed.
[orientation] – the specified orientation of the page to be printed; the default is Portrait mode
[units] – the specified units for the width and height of the page to be printed; the default is pixels
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//Set page format to a custom size of 100x200 pixels with 10 pixel margins on all sides in portrait mode
forms.customer.controller.setPageFormat(100, 200, 10, 10, 10, 10);

//Set page format to a custom size of 100x200 mm in landscape mode
forms.customer.controller.setPageFormat(100, 200, 0, 0, 0, 0, 0, 0);

//Set page format to a custom size of 100x200 inch in portrait mode
forms.customer.controller.setPageFormat(100, 200, 0, 0, 0, 0, 1, 1);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetPreferredPrinter
classnode
Table Row (tr)
idname
Table Cell (td)
setPreferredPrinter
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setPreferredPrinter
Span
stylefloat: left;
idiets
(printerName)
Table Row (tr)
iddes
Table Cell (td)
Set the preferred printer name to use when printing.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} printerName – The name of the printer to be used when printing.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.setPreferredPrinter('HP Laser 2200');
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetSelectedIndex
classnode
Table Row (tr)
idname
Table Cell (td)
setSelectedIndex
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setSelectedIndex
Span
stylefloat: left;
idiets
(index)
Table Row (tr)
iddes
Table Cell (td)
Sets the current record index of the current foundset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} index – the index to select
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//gets the current record index in the current foundset
var current = forms.customer.controller.getSelectedIndex();
//sets the next record in the foundset, will be reflected in UI
forms.customer.controller.setSelectedIndex(current+1);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetTabSequence
classnode
Table Row (tr)
idname
Table Cell (td)
setTabSequence
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setTabSequence
Span
stylefloat: left;
idiets
(arrayOfElements)
Table Row (tr)
iddes
Table Cell (td)
Set the tab order sequence programatically, by passing the elements references in a javascript array.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Object[]} arrayOfElements – array containing the element references
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.setTabSequence([forms.customer.elements.fld_order_id, forms.customer.elements.fld_order_amount]);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idshow
classnode
Table Row (tr)
idname
Table Cell (td)
show
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
show
Span
stylefloat: left;
idiets
([window])
Table Row (tr)
iddes
Table Cell (td)
Shows the form (makes the form visible), optionally showing it in the specified JSWindow.
This function does not affect the form foundset in any way.
Table Row (tr)
idprs
Table Cell (td)
Parameters
[window] – the window in which this form should be shown. If it is unspecified the current window will be used.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
application.createWindow
application.getWindow
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// show the form in the current window/dialog
forms.customer.controller.show();
// show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
forms.customer.controller.show(w);
// show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
forms.customer.controller.show(w);
//show the form in the main window
//forms.customer.controller.show(null);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idshowPrintPreview
classnode
Table Row (tr)
idname
Table Cell (td)
showPrintPreview
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
showPrintPreview
Span
stylefloat: left;
idiets
([printCurrentRecordOnly], [printerJob], [zoomFactor])
Table Row (tr)
iddes
Table Cell (td)
Show this form in print preview.
Table Row (tr)
idprs
Table Cell (td)
Parameters
[printCurrentRecordOnly] – to print the current record only
[printerJob] – print to plugin printer job, see pdf printer plugin for example (incase print is used from printpreview)
[zoomFactor] – a specified number value from 10-400
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//shows this form (with foundset records) in print preview
forms.customer.controller.showPrintPreview();
//to print preview current record only
//forms.customer.controller.showPrintPreview(true);
//to print preview current record only with 125% zoom factor; 
//forms.customer.controller.showPrintPreview(true, null, 125);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idshowRecords
classnode
Table Row (tr)
idname
Table Cell (td)
showRecords
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
showRecords
Span
stylefloat: left;
idiets
(data, [window])
Table Row (tr)
iddes
Table Cell (td)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
Table Row (tr)
idprs
Table Cell (td)
Parameters
data – the foundset/pkdataset/singleNumber_pk/UUIDpk to load before showing the form.
[window] – the window in which this form should be shown.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsee
Table Cell (td)
Also see
Div
classsIndent
application.createWindow
application.getWindow
controller.loadRecords
controller.show
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
forms.customer.controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
forms.customer.controller.showRecords(foundset, w);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsort
classnode
Table Row (tr)
idname
Table Cell (td)
sort
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
sort
Span
stylefloat: left;
idiets
(sortString, [defer])
Table Row (tr)
iddes
Table Cell (td)
Sorts the form foundset based on the given sort string.
TIP: You can use the Copy button in the developer Select Sorting Fields dialog to get the needed syntax string for the desired sort fields/order.
Table Row (tr)
idprs
Table Cell (td)
Parameters
sortString – the specified columns (and sort order)
[defer] – the "sortString" will be just stored, without performing a query on the database (the actual sorting will be deferred until the next data loading action).
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.sort('columnA desc,columnB asc');
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsortDialog
classnode
Table Row (tr)
idname
Table Cell (td)
sortDialog
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
sortDialog
Span
stylefloat: left;
idiets
([sortString])
Table Row (tr)
iddes
Table Cell (td)
Show the sort dialog to the user a preselection sortString can be passed, to sort the form foundset.
TIP: You can use the Copy button in the developer Select Sorting Fields dialog to get the needed syntax string for the desired sort fields/order.
Table Row (tr)
idprs
Table Cell (td)
Parameters
[sortString] – the specified columns (and sort order)
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
forms.customer.controller.sortDialog('columnA desc,columnB asc');
Table Row (tr)
classlastDetailRow
Table Cell (td)