Accessing Control and Layout Properties from scripts

 

Documentation home

 

Control properties 1

Javascript 1

FPL 1

Layout Properties 2

Javascript 2

FPL 2

 

Control properties

Almost all control properties can be accessed from a script using either Javascript or FPL.

Javascript

Control properties are addressed using the getter/setter methods on the control or by getting or setting a control property. See the API Javadoc for full details.

 

Examples:

 

controls.FldA6gr2.newLine = true;

controls.headerText23.textColor = "#FF66CC";

controls.headerText23.setTextColor("#FF66CC");

controls.Field06.immediateValidation = false;

controls.customersTable.width = "50%";

 

Property values are case sensitive.

 

FPL

The documentation for each control includes a table of all properties and indicates whether get (read access) and/or set (write access) is supported. The property name is also shown.

 

A property is referenced as <controlname>[.<qualifier>[.qualifier]..].<propertyname>

 

Controlname, Propertyname and Qualifiers are not case sensitive.

Qualifier identifies a particular subset of properties. Qualifiers may or may not be needed depending on the control and the property; there may be multiple levels of qualifier. Refer to the documentation for each control or layout for qualifier ids. Qualifiers for layouts and layout override properties are shown above the table of properties. Other qualifiers are identified by a group of properties that have an assigned name as shown in the example below: labelBackground is a qualifier that identifies the background group of properties.

 

         

 

 

Properties are set using the set FPL command e.g.

 

set FIELD05.newLine = 'true';

set TEXT1.textColor = '#FF66CC';

set FIELD06.immediateValidation = 'false';

set TABLE1.width = '50%';

 

Property values are case sensitive.

 

Layout Properties

Javascript

The layout properties of a container control are addressed via the layout property (or getLayout() method); this returns a Layout object of the appropriate type as shown in the table below based on the layout type configured for the container control. The layout properties that apply to each child control within a parent container control are called layout cell properties and these are addressed via the layoutCell property (or getLayoutCell() method) on the child control; this returns a LayoutCell object of the appropriate type as shown in the table below.

 

Container control layout

Layout type

Layout cell type

Horizontal Box

HorizontalBoxLayout

HorizontalBoxLayoutCell

Vertical Box

VerticalBoxLayout

VerticalBoxLayoutCell

Field Grid

FieldLayout

FieldLayoutCell

Column

ColumnLayout

ColumnLayoutCell

Flow

FlowLayout

No properties exist

List

ListLayout

ListLayoutCell

BootstrapField

BootstrapFieldLayout

No properties exist

 

Examples:

 

controls.EditPanel2.layout.backgroundColor = "red";       // Field Grid Layout

controls.InfoPanel.layout.spacerSize = "10px";            // Horizontal Box layout

controls.saveButton.layoutCell.labelHAlign = "Center";    // Field Grid layout

 

FPL

Layout and layout override properties use qualifiers layoutProperties and layoutCellProperties respectively:

 

set PANEL1.layoutProperties.FIELD.backgroundColor = 'red';

set PANEL1.layoutProperties.HORIZONTAL_BOX.spacerSize = '10px';

set BUTTON1.layoutCellProperties.FIELD.labelHAlign = 'Center';

 

The layout qualifiers are shown immediately above the table of properties in the documentation for each layout, and are:

 

Horizontal Box:

HORIZONTAL_BOX

Vertical Box:

VERTICAL_BOX

Field Grid:

FIELD

Column:

COLUMN

Flow:

FLOW

 

Properties are read by referring to the control property in an FPL expression e.g.

 

if [FIELD05.hyperlink = 'true' ]

 

endif

set PANEL1.style = PANEL1.style + 'background-color:red;';

set XXX = TABLE2.tableHeaderText;

 

Boolean properties will return a character string of either 'true' or 'false' when read, and should be set using a character string of either 'true' or 'false'.