menuitem[type].formwidget
For some menu's that contain checkboxes and radiobuttons, or
that contain submenuus, it is hard to interpret a desired value
of the containing widget (the menu).
In these cases, you can use the <menuitem type="blah" class="formwidget"
so each menuitem is itself a formwidget. The only menuitems that are
usefull as data container are menuitems that can be checked,
radio's and checkbuttons. The menuitem will return it's
name/value/label only when checked.
The containing widget (menulist,button,menu) should be a normal
XUL element, not a formwidget.
Note: what goes into menulike things can be very
diverse. Even XUL itself yields confusing results,
as the testsuite demonstrates.
Note 2: menuitem[type=radio] already has a name attribute in xul. The idea is
that menuitems of type radio with the same name belong to the same group,
and only one such menuitem can be checked in a group at the same time.
Unfortunately, some Mozillas seem to ignore that idea when checking menuitems
with javascript. That's a bug.
Note3: when seeding, checkbox menuitems are never unchecked.
Such is the nature of a checkbox: if it is not checked,
it doesn't mean it should be unchecked; it means nothing.
If you need a switch, use radiobuttons.
Note4: For some Mozillas, it appears the binding for a menuitem
is not made until the item has been 'used' in some. For example,
if the item is hidden inside a submenu, it isn't a formwidget until
you look at it :) . That's another bug.
Example:
result:
seed:mitem/yes/check2
cgi:mitem=yes
Additional Attributes:
name
The name of the widget. Used as the name of the variable in CGI.
value
The value of the widget. Used as the value 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, value and label of this
element.
Additional Methods: