I would create a BooleanDropDownChoice component and put localizations on that component: that way it would be easier to reuse it for different "projects". For the IChoiceRenderer I would do something similar to EnumChoiceRenderer: i.e. return localized values for "Boolean.TRUE" and "Boolen.FALSE" using BooleanDropDownChoice component to retrieve those values.
Best, Ernesto On Thu, Jun 17, 2010 at 2:45 PM, Sam Zilverberg <samzilverb...@gmail.com> wrote: > I've created a simple BooleanChoiceRenderer that I use along with > ChoiceFilteredPropertyColumn that maps to a Boolean property. > > public class BooleanChoiceRenderer implements IChoiceRenderer<Boolean> { > > public BooleanChoiceRenderer() { > } > > public Object getDisplayValue(Boolean object) { > return object == null ? "" : object ? "Y" : "N"; > } > > public String getIdValue(Boolean object, int index) { > return object == null ? "" : object.toString(); > } > } > > This works fine, however, I'd like to use i18n and pull the values for > True/False from a property file. > Preferably a top level property file like WicketApplication.properties where > I keep properties that are used throughout the app such as nullValid=Any (to > replace "Choose one" in DDC). > > *What is the best way to achieve this? I've searched nabble for a while but > didn't find anything :( > > *Is there some "Global" mechanism to make displayed values for Booleans > throughout the app be certain values? > so that each time I use a Column that maps to a Boolean property I don't > need to override populateItem and decide what will be displayed for > True/False. > > Thanks > -Sam > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org