Widgets

This section includes all of the Mojo widgets. Each widget section includes a brief description repeating some of the information from Chapters 3, 4, and 5, followed by an enumeration of the widget’s attribute and model properties, relevant events, and public methods.

Button

Buttons are the most basic UI element, bounding an action to a region. When a button is pushed, it can change state but gracefully returns to the previous state, like a doorbell.

Attribute properties

Type

Description

type

String

Choices:

Mojo.Widget.defaultButton
Mojo.Widget.activityButton
disabledProperty

Boolean

Name of model property for disabled state

label

String

Displayed label

labelProperty

String

Model property name for label

Model properties

Type

Description

buttonClass
StringStyle options are primary, secondary, dismissal, affirmative, or negative
label

String

Displayed label

disabled

Boolean

Default property that when true, disables the widget

Events

Mojo.Event.tap

Methods

activate()

For an activity button, start the spinner

deactivate()

For an activity button, stop the spinner

Check Box

A Check Box widget is used to control and indicate a binary state value in one element.

Attribute properties

Type

Description

modelProperty

String

Name of model property for widget state

disabledProperty

String

Name of model property for disabled state

trueValue

String

Value to set modelProperty when widget state is true

falseValue

String

Value to set modelProperty when widget state is false

inputName

String

Identifier for the value of the check box; used when ...

Get Palm webOS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.