List

List element

A list element represents a list of items on the UI.

Syntax of the list element

list <list-id> {<list-descriptor>}

where:

  • The <list-id> is the name of the list.

  • The <page-descriptor> defines the elements and the look of the list element.

Events of the list

The list UI element supports following events:

  • on selection changed: this event is fired when the user selects a new element in the list.

Example on selection changed event of the Example list
1function onExampleListSelectionChanged(originId) {
2  debug("Selection changed: " + $IN.toString());
3  var selectedRecord = $IN.data;
4  // business logic to be executed according to the application logic
5}

Dictionary keys of the list

The label and icon of the actions of the list items are defined in the dictionary, the corresponding key has the form of ‘page_<structure-to-list>_<list-name>_<item-action-name>_label’ and ‘page_<structure-to-list>_<list-name>_<item-action-name>_icon’. For possible icon values check the Icons API documentation page.

Dictionary key definition for ExampleList list in the mobile_dictionary_en.properties file
1page_ExamplePage_ExampleList_ExampleAction_label=Example
2page_ExamplePage_ExampleList_ExampleAction_icon=\ue91f

Syntax of the list descriptor

The list descriptor can contain one or more attribute descriptors.

(<attribute-descriptor>[,|;])+ <list-actions> <list-columns>

where:

  • Multiple <attirbute-descriptor> can be defined, the definitions are optionally separated by ‘,’ or ‘;’.

  • The <list-actions> block defines page level actions.

  • The <list-columns> block contains column definitions used by the item template.

Syntax of the list attribute descriptor

<attirubte-name>: <attribute-value>

where:

  • List of valid attribute names and values are defined by client device types below.

Valid list attribute names and values

The following table describes the valid attribute names and values.

Valid list attribute keys and values

Attribute name

Description

Valid values

Example

template

Defines the template to be used

TBD

template: listVerticalNormal,

itemTemplate

Defines the itemTemplate to be used

listItemMultiLine, listItemCard, listItemCalendar and grid (for legacy support only),

itemTemplate: listItemCard;

filterVisible

Defines if the list filter is visible

Boolean value: true or false, default value is false

scolvoMenuVisible: true;

span

Defines the span of the list

Number

span: 0;

Syntax of the list actions

actions: <action-list>[,|;]

where:

  • The actions is defined by ‘actions’ keyword and the list of actions. This definition can be optionally separated from other page description elements by ‘,’ or ‘;’.

Syntax of the list action-list

[<action-name>+]

where:

  • The action list is defined as collection of strings (in []), where the action names are double-quoted strings. E.g.: [“FirstPageAction”, “SecondPageAction”].

Syntax of the list columns

columns: <column-list>[,|;]

where:

  • The columns are defined by ‘columns’ keyword and the list of columns. This definition can be optionally separated from other page description elements by ‘,’ or ‘;’.

Syntax of the list column-list

[<column-key> => <row-property-name>+]

where the possible column-keys are depending on the itemTemplate with following mapping:

Valid colum keys and itemTemplates

Item template

Column keys

Example mapping

listItemCard

title and text

title => title, text => content

listItemMultiLine

mainText and subText

mainText => title, subText => content

Example list definition

There are different list examples defined in Scolvo Script lessons: in List page with card template and in List page with simple template .