Hi Greeklinux,

Please see my earlier reply on a similar question.
http://www.nabble.com/DropDownChoice-getting-value-into-the-model-td15905486.html#a15906830

I am not sure the wiki page is correct.

Regards,
   Erik.


greeklinux wrote:
Hello,

I want to localize a DropDownChoice component. I read the examples
http://www.wicket-library.com/wicket-examples/compref/
and http://cwiki.apache.org/WICKET/dropdownchoice-examples.html.

The displayed option value is a localized string and the value is a key that
will be stored in DB.

Now I want to get the value of a selected option and store this in a form
CompoundPropertyModel.
The Object backing the model will be stored in DB.

-----code

private SelectChoise[] myList = {
        new SelectChoise("alglg", new ResourceModel("list.alglg")),
        new SelectChoise("algmd", new ResourceModel("list.algmd")) }

....

DropDownChoice listInput = new DropDownChoice("listInput", formModel,
Arrays.asList(myList), new ChoiceRenderer("value", "key"));

------


But I get a runtime exception. Because the expression "key" cannot be
applied on the class that is backing
my formModel. I thought that the "key" is applied on the List SelectChoise
class.

Can someone give me a hint?

Thanks a lot



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to