Switch
A Switch widget is a toggle switch with a sliding knob. A Switch widget is used to display boolean settings.
Derived base
dojox.mobile.Switch
Properties
dataName
The name of a data element to which the widget is bound. If no data to be sent to the server, leave this property blank.
id
A unique ID string for the widget.
leftLabel
This property specifies the label to be displayed on the left side of the widget.
rightLabel
This property specifies the label to be displayed on the right side of the widget.
shape
The shape for the widget.
value
The value of the widget.
ECA editor support
Events that can be added to the Switch widget with the ECA editor
onClick
This event is called when you tap the widget.
onTouchEnd
This event is called when you move your touch point outside of the widget.
onTouchMove
This event is called when you move your touch point on the widget.
onTouchStart
This event is called when you touch the widget.
onStateChanged
This event is called when the state of the Switch widget is changed.
Properties that can be configured for the Switch widget with the ECA editor
focused
false
The widget does not get focus.
true
The widget gets focus.
Applicable ECA part: Condition, Expression in Condition
value
The value of the widget.
Applicable ECA part: Condition, Expression in Condition
id
A unique ID string for the widget.
Applicable ECA part: Expression in Condition
Functions that can be configured for the Switch widget with the ECA editor
set(name,value)
Set a value for a widget property.
Applicable ECA part: Actions
reset()
Reset the value of the widget to the initial value.
Applicable ECA part: Actions
get(name)
Returns the value of a widget property.
Applicable ECA part: Expression in Condition
See also