* 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
argument:
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.
HTH,
--
Jean-Baptiste Quenot
aka John Banana Qwerty
http://caraldi.com/jbq/
-------------------------------------------------------------------------
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
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user