choice
Furnace framework » Furnace presentation layer » HTML components

Prev:checkbox
Next:code


Vocabulary
html.components

Class description
Choice components render a popup menu or list box with either single or multiple selection.

The multiple slot determines whether multiple elements may be selected at once; if this is set to a true value, then the component value must be a sequence of strings, otherwise it must be a single string.

The size slot determines the number of items visible at one time; if neither this nor multiple is set, the component is rendered as a popup menu rather than a list.

The choices slot determines all possible choices which may be selected. It names a value, rather than storing the choices directly.

Definition

TUPLE: choice size multiple choices ;


Methods

M:: choice render* ( value name choice -- xml )
choice size>> :> size choice multiple>> "true" and
:> multiple value choice render-options :> contents H{
{ "name" name }
{ "multiple" multiple }
{ "contents" contents }
{ "size" size }
} T{ xml-chunk
{ seq
V{
""
T{ tag
{ name ~name~ }
{ attrs ~attrs~ }
{ children ~vector~ }
}
""
}
}
} interpolate-xml ;