Thank you for your fast answer!

It makes sense. I made the following changes:

CompoundPropertyModel:
private Language defaultSystemLanguage; (with the correct gets/sets)

Submit:
System.out.println ("LANGUAGE BY DEFAULT:" +
userInformation.getDefaultSystemLanguage().getLanguageID());

And now the error changes to:
wicket.util.convert.ConversionException: Can't convert value: languageID:14
- languageName:Japanese to class: class
iJoinApplication.Entity.Registration.Language for setting it on
[EMAIL PROTECTED]

UserInformation is the CompoundPropertyModel whose defaultSystemLanguage
property I changed to Language object.

Again, thank you so much for all your help.
Oskar





igor.vaynberg wrote:
> 
> On 7/17/07, Toscano <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hello,
>>
>> I have a huge form with a lot of dropdowns, and I'm using a
>> CompoundPropertyModel. The form can also be changed between more than six
>> languages, so everytime the user changes one value in one Dropdown, all
>> the
>> form is refreshed showing the DropDowns in the selected language.
>> The problem is for getting the selected values of the DropDowns when
>> submit...
>>
>> Here is the code:
>> Declaration of one of the combos in the page class:
>>
>>          defaultSystemLanguage = new
>> DropDownChoice("defaultSystemLanguage",
>>          new LoadableDetachableModel() {protected Object load() {return
>> getImplementedLanguages();}},
>>          new ChoiceRenderer ("languageName", "languageID"));
>>         defaultSystemLanguage.setNullValid(true);
>>
>> CompoundPropertyModel:
>>     private String defaultSystemLanguage; (with gets/sets)
>>
>> onSubmit:
>>     public void onSubmit() {
>>            System.out.println ("LANGUAGE BY DEFAULT:" +
>> userInformation.getDefaultSystemLanguage());
>>
>> This causes the following error:
>>
>> wicket.WicketRuntimeException: No get method defined for class: class
>> java.lang.String expression: languageID
>>
>> What I'm doing wrong? If I specify a CompoundPropertyModel with one
>> property
>> with the same name as the DropDown, isn't supposed to be mapped directly
>> there?
> 
> 
> your model object is of type String as it maps to the String
> defaultSystemLanguage. your renderer however expects an object it can call
> getLanguageName() and getLanaguageId() on - as you have defined. so make
> defaultSystemLanguage your Language object instead of just a string.
> 
> -igor
> 
> 
> 
> 
> Thanks in advance,
>> Oskar
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Retrieve-selected-value-from-DropDown-tf4100672.html#a11661363
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Retrieve-selected-value-from-DropDown-tf4100672.html#a11661751
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to