Flip Switch

Table of Contents

flipswitch

The flipswitch component displays a command button that toggles between an On and Off state. This UI element is common on the iOS platform for toggling a setting on or off. This component generates server side action event when pressed.  SingleSubmit = "true" means that the button will submit itself and render the page with whatever has changed (typicaly ICEfaces 2.0 singleSubmit behaviour). This component is also supported by the mobi:ajax tag for more options on ajax support.

SingleSubmit = false means the state of the button stays on the client until the form is submitted with some other component (typically a submit button).

Usage

  • singleSubmit = "false" .  The value stays on the client until form submission. (this is the default)
<h:outputLabel for="cor" value="Auto-Correction"/>
<mobi:flipswitch id="cor" style="float:right"
                        labelOn="ON" labelOff="OFF"
                        value="#{flipSwitchBean.autoCorrection}"/>
  • singleSubmit = "true" .  The value is submitted immediately to the server and any page markup that changes as a result is re-rendered.
<h:outputLabel for="cor" value="Auto-Correction"/>
<mobi:flipswitch id="cor" style="float:right" singleSubmit="true"
                        labelOn="ON" labelOff="OFF"
                        value="#{flipSwitchBean.autoCorrection}"/>

Theming

FlipSwitch supports device theming by providing default styles for Apple, Android and Blackberry.  CSS class names are as follows:

  • mobi-flip-switch (mobi-flip-switch-off | mobi-flip-switch-off)
    • mobi-flip-switch-txt

Component Documentation

flipswitch

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2016 ICEsoft Technologies Canada Corp.