menulist.formwidget
The
<menulist class="formwidget"
holds the name and label
of the widget, the selectedItem holds the value. If the selectedItem has no value, it's label
is used. You should use plain menuitems. If you have checkboxes, radiobuttons
or nested menus in your menu, you dont want this kind of formwidget,
use
typed menuitems. As a result, the menulist
formwidget is a single select flat menulist.
When seeded, the menulist matches any seed with the same
name
.
It searches for a menuitem with the same
value
as the
matching seed and selects that. If none is found,
it sets the menulists value and label to the seeds values.
Note: in XUL, menulists have label and value properties.
Once you select an item, the menulist's properties are set; with
an editable menulist, this turns the menuitem's label into the
menulist's value. reversely, with non-editable menulists the menulist's
label can be changed by javascript without changing the selected item's label.
Setting the menulist's value property tries to select a menuitem.
Confusing as it is, formwidgets try to follow that behaviour.
The menubar is not implemented.
Example:
result:
seed:ml/item1/the first item
cgi:ml=item1
Additional Attributes:
name
The name of the widget. Used as the name of the variable in CGI
-
onvalidate
pseudo event handler. should point to a method to execute
for validation. when validating, the method will receive a bucket
with a single seed in it, reflecting the name and label of the menulist
and the value of the selected element.
Additional Methods: