List Class Reference

Essential List.addItem(label, onclick, style) List.addItemTitle(title, subtitle, onclick, style) List.addItemLabel(label, value, onclick, style) List.addItemSubtitle(title, subtitle onclick, style) List.addImage(url, onclick, style) List.addHeader(title, style) Editable Items List.addTextBox(id, label, value, onchange, style) List.addComboBox(id, label, value, onchange, options) List.addComboBoxMulti(id, label, value, onchange, options) List.addCheckBox(id, label, checked, onchange) List.addToggleBox(id, label, value, onchange, options) List.addButton(label, onclick, style)
Display and Control List.show(style) List.setValue(id, value) List.getValue(id)

Overview

This is the main class to add items in a screen. It is used for both normal and editable items. All methods in this class are static. Typically you call methods like List.addItem() followed by a final call to List.show()

List.addItem(label, onclick, style)

Adds a clickable list item. label (string) is the title label, onclick (string) is an optional callback function

List.addItem("John", "viewContact()", "img:contact;icon:arrow");

List.addItemSubtitle(title, subtitle onclick, style)

Adds a list item, with a title (string) a gray subtitle(string), onclick (string) is an optional callback function

List.addItemSubtitle("John", "Sales Manager", "viewContact()", "img:company");

List.addItemLabel(label, value, onclick, style)

Adds a label, value list item. label (string) is displayed in blue and value (string) below it, onclick (string) is an optional callback function.

List.addItemLabel("Email", "john@gmail.com", "App.mail(this.value)");
If value is null or empty string, no item is displayed on the screen

List.addItemTitle(title, subtitle, onclick, style)

Adds an item with a centered big title (string) am optional subtitle (string) below. onclick (string) is an optional callback function

List.addItemTitle("Total Pipeline Sales", "$67,000", "", "color:white;background-color:" + Color.GREEN);

List.addImage(url, onclick, style)

Adds an image item in the list. url (string) is an absolute http url pointing to an image. onclick (string) is an optional callback function

List.addImage("http://www.upvise.com/img/logo.png", "App.alert('Hi')");

List.addHeader(title, style)

Adds a list item header, which is a non clickable gray separator

List.addHeader("Tools");

List.addTextBox(id, label, value, onchange, style)

Adds an editable text item in the list.

var task = Query.selectId('tasks', recordid);
var onchange = "Query.updateId('tasks',{recordid},this.id,this.value)";
List.addTextBox("name", "Task Name", task.name, onchange);
List.addTextBox("duedate", "Due Date", task.duedate, onchange, "datetime");

List.addComboBox(id, label, value, onchange, options)

Adds an editable combo box item in the list.

var task = Query.selectId('tasks', recordid);
var onchange = "Query.updateId('tasks',{recordid},this.id,this.value)";
List.addComboBox("status", "Task Status", task.status, onchange, "0:Open|1:Fixed|2:Closed");

List.addComboBoxMulti(id, label, value, onchange, options)

Adds an editable combo box item in the list where use can select multiple values

var contact = Query.selectId('contacts', recordid);
var onchange = "Query.updateId('contacts',{recordid},this.id,this.value)";
List.addComboBoxMulti("groupid", "Contact Group", contact.groupid, onchange, "0:MyTeam|1:Favorite|2:Important");

List.addCheckBox(id, label, checked, onchange)

Adds an checkbox item in the list

var task = Query.selectId('tasks', recordid);
var onchange = "Query.updateId('tasks',{recordid},this.id,this.value)";
List.addComboBox("important", "Important", task.important, onchange);

List.addButton(label, onclick, style)

Adds a button item in the list.

List.addToggleBox(id, label, value, onchange, options)

Add a set of toggle buttons (Android only).

List.setValue(id, value)

Set the value (string) of a editable item identified by with id (string)

List.getValue(id)

Returns the string value of the list item value identified with id or null if not found

List.show(style)

display the list and toolbar on the screen. Must be the last call of the List class.

style is an optional string: can be "popup" to display the list as a popup (not added in the history)