behavior: check

Standard checkbox button implementation. This behavior is pretty simple: on click it toggles :checked state flag on the element. You can assign this behavior to other elements that you would like to behave as a “toggle”.

Elements

that have this behavior applied by default:

  • <input type=“checkbox”> - standard HTML inline radio button;
  • <widget type=“checkbox”> - radio button - block;
  • <button type=“checkbox”> - Windows like inline radio button, use it as <button type=“radio”>caption</button>.

And tristate checkbox:

  • <input type=“checkbox” mixed> - standard HTML inline radio button;
  • <widget type=“checkbox” mixed> - radio button - block;
  • <button type=“checkbox” mixed> - Windows like inline radio button, use it as <button type=“radio”>caption</button>.

Attributes

that this behavior knows about:

  • checked - if provided will initialize value of runtime state of the flag :checked.

For the tristate checkbox the checked value may have following values

  • checked=true - checkbox is “on”;
  • checked=false - checkbox is “off”;
  • checked=undefined - checkbox is in undetermined state (mixed state);

Events

Together with the standard set of events (mouse, keyboard, focus) behavior: radio generates:

  • BUTTON_STATE_CHANGED event - the button just changed its state to checked. Asynchronous event.
  • BUTTON_PRESS event - mouse down or spacebar key down when button is in focus. Synchronous event.

Value

type json::value::V_BOOL, reflects current status of :checked state flag.

Tristate checkbox accepts three values:

json::value(true), json::value(false) and json::value() (undefined)

h-smile/built-in-behaviors/checkbox.txt · Last modified: 2010/12/01 14:37 by andrew
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0