behavior: select

select is what known as LISTBOX in Windows. In h-smile select is extended to support so called TreeView functionality and listbox with multiple selections.

Elements

that have this behavior applied by default (see master style sheet):

  • <select size=N>…</select> , where N is number greater than 1
  • <widget type=“select”></widget>

In h-smile <select> can have any arbitrary markup inside but following elements have special meaning:

  • <option>…</option> - option element - item of the list.
  • <options>…</options> - container of other option and/or options - node of the tree.
  • <optgroup>…</optgroup> - container of options - grouping element.

Attributes

this behavior knows about:

  • size=“N” - number of visible itemsin the list.
  • multiple - if defined allows to select more than one item.
  • multiple=“checks” - allows to select more than one item and <option>s rendered with check marks.

Events

Besides of standard set of events (mouse, keyboard, focus) behavior:select generates:

  • SELECT_SELECTION_CHANGED event - selection was changed due to user interaction.
  • SELECT_STATE_CHANGED event - state of <options> (tree node) was changed: collapsed or expanded. Field target of event structure is a reference to the node element that was changed.

Value

  • single selectable lists - value is value of the selected <option> - either content of value attribute or text of the <option>.
  • multi-selectable lists - value is an array of values of selected <option>s.

Special key combinations

  • LEFT - for nodes, collapse current node (options element);
  • RIGHT - for nodes, expand current node (options element);
  • UP / PAGE-UP - previous item;
  • DOWN / PAGE-DOWN- next item;
  • SHIFT + UP/PAGE-UP - same as above but with selection;
  • SHIFT + UP/PAGE-DOWN - same as above but with selection;
  • HOME - first item in the list;
  • END - last item in the list;
You can override styles of the <select> and its content, see master style sheet and html_samples/forms/selects.htm and nearby.
h-smile/built-in-behaviors/select.txt · Last modified: 2007/12/13 03:01 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