* Vincent Jenks:

> [...] how can I set, say, a Map of name/value pairs of Strings?
> In  this case  I'm  not providing  a List<T>  of  values to  the
> dropdown but  rather a  Map<String, String>  of static  values -
> unless of course there's an easier way.
> This  control still  feels cumbersome  to work  worth....perhaps
> it's just me?

I agree it's a bit tricky to make DropDownChoice display a label
different from the ID.

You have to use the constructor with the IChoiceRenderer as last

  DropDownChoice(java.lang.String id, IModel model, IModel choices, 
IChoiceRenderer renderer)

Then you must implement a new IChoiceRenderer, passing your map to
the constructor.  Feel free to contribute it to Wicket when you're
done, it will be useful for most of us:

Currently the only IChoiceRenderer implementation is
ChoiceRenderer, but the ID (value submitted) is the index in the
choices list, not an arbitrary String value.

     Jean-Baptiste Quenot
aka  John Banana Qwerty

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
Wicket-user mailing list

Reply via email to