Krang::ElementClass::PopupMenu - popup menu element class
$class = pkg('ElementClass::PopupMenu')->new(name => "alignment",
values => [ 'center', 'left', 'right' ],
labels => { center => "Center",
left => "Left",
right => "Right" });
Provides a popup menu element class. Otherwise known as a select box
in HTML, but differentiated from Krang::ElementClass::ListBox by the
fact that it never allows more than one option to be selected. As a
result, $element->data() contains a scalar value for elements
of this class.
All the normal Krang::ElementClass attributes are available, plus:
A reference to an array of values for the select box.
This can also be a code reference that will return an array reference.
This is really helpful when you don't know ahead of time what possible
values might be in the list, or they might change based on other actions.
This code reference will be called as a method in the element class with the
same arguments that are passed to element class's input_form().
A reference to a hash mapping values to display names.
This can also be a code reference that will return a hash reference.
This is really helpful when you don't know ahead of time what possible
values might be in the list, or they might change based on other actions.
This code reference will be called as a method in the element class with the
same arguments that are passed to element class's input_form().