Reputation: 3
I have a problem with displaying options in a DropDownChoice (wicket 1.6).
DropDownChoice<Boolean> choice = new DropDownChoice<Boolean>("enabled", Arrays.asList(true, false), new ChoiceRenderer<Boolean>());
choice.setNullValid(true);
choice.setOutputMarkupId(true);
enabled.nullValid=Not selected
enabled.true=Yes
enabled.false=No
nullValid is displayed properly, true and fals is not. How can I display yes and no instead of true and fals?
Upvotes: 0
Views: 279
Reputation: 5681
Use a custom IChoiceRenderer or override #localizeDisplayValues() to return true
and define values in your resource property files (possibly prepended with the component path):
true = yes
false = no
Upvotes: 2