Krang::ElementClass::ListBox - list box element class
$class = pkg('ElementClass::ListBox')->new(name => "color",
size => 1,
values => [ 'red', 'white', 'blue' ],
labels => { red => "Red",
white => "White",
blue => "Blue" }.
default => [ 'white' ],
);
Provides a list 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.
Elements using this class must contain references to arrays in data(), even if multiple is 0.
All the normal Krang::ElementClass attributes are available, plus:
size greater than 1 if you set multiple
true.
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().
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().