Can I disable certain items in Wicket DropDownChoice?

Suppose I created a Wicket DropDownChoicecontaining several elements.

Is it possible to display all the elements, but selectively disable one or more of them?

The only control that you use when elements appear is provided IChoiceRenderer, but it allows you to change the text displayed for each element.

+4
source share
1 answer

A short search on this issue has returned: http://apache-wicket.1842946.n4.nabble.com/disable-a-DropdownChoice-item-td1893424.html which seems to work for the user.

, AbstractChoice, DropdownChoice

protected boolean isDisabled(final E object, int index, String selected)
 {
     return false;
 }

, , Select2 (http://ivaynberg.imtqy.com/select2/), , , .

+5

All Articles