As the topic says, can I have a Select that renders as in multiselect mode (as a list of items, without the drop-down dialogue), but allows only one item to be selected?
Sure, it can be seen in our
FeatureBrowser demo
, “Choices, choices”.
Just use the class ListSelect.
Select sel = new ListSelect();
Ah, thanks. Didn’t know that existed separately.
(checked only the online reference manual)
It seems like it will be rendered as a simpe select (with dropdown dialogue) when the ListSelect contains only one element.
Have I missed something (a method, setting, theme-related stuff?) to force it to be a list with only one item listed.
Try setting an explicit height for the component, e.g. setHeight(“5em”);
No help, the widget got just stretched vertically, but the drop down is still present.
Actually, to be precise, I’m manually setting the setRows(); according to the amount of elements inside, so maybe (probably) the setRows(1) is the culprit, not the amount of elements themselves…