A Custom List is a list built in an server-side event, for example, a Before Page event that generates a list using a data provided by a RESTful Web Service.
Custom Lists can be created for
Field,
Table Columns and
List Control's using the JavaScript API:
// create a list for a Field with three entries
var list1 = ["Line 1", "Line 2", "Line 3"];
fields.myField.createCustomList(list1);
// create a list for a List Control with both displayed and return values
var list2 = controls.myListControl.createCustomList();
list2.add("Display Value 1", "Returned value 1");
list2.add("Display Value 2", "Returned value 2");
If a single value is specified for each list item, it is used as both the display and return value.
Creating or modifying a Custom List for a Field automatically updates all its
Field Controls with the new list data.
The List can be updated using the JavaScript list
interface for a Field, Table Column or List Control to:
- add a list item:
fields.myField.list.add("Line 4");
.
- remove a list item:
tables.myTable.myTableColumn.list.remove("Line 4");
.
- clear remove all entries from the list:
controls.myListControl.list.clear();
.
You can also get the:
- display value for example:
fields.myField.list.getDisplayValue("Display value 1");
- return value for example:
fields.myField.list.getReturnValue("Returned value 1");