Hello, Thank you very much for your fast answer. I'm using what you said, but sure I'm not doing in the way I should because it doesn't work as expected. Now I can get keep the country selected, but it is not refreshed when changing the locale.
This is what I have: countries = new DropDownChoice ("country", new Model() { public List getObject() { return getCountries(); } }, getCountries(), new CountryChoiceRenderer()); I think that the getObject method is never called. The getCountries ones is prepared so that if the user changes the locale, it gets the correct names for the countries. So I just need getCountries to be called everytime the languages dropdown is changed. So,I think I should write something in this method of the languages DropDownChoice: public void onSelectionChanged (Object newSelection) { } Again, thank you very much for your help. Oskar Martijn Dashorst wrote: > > 2 things: > > 1. Probably you should use an IChoiceRenderer in addition to your current > list. > 2. you *replace* the component, and with it the selected value, better > to use a lazy model to retrieve the list of countries, instead of > pushing it to the component > > ad 2: > > new DDC("countries", new Model() { public void getObject(...) { return > getCountries(); } }, new CountryChoiceRenderer()); > > Martijn > > On 3/29/07, Toscano <[EMAIL PROTECTED]> wrote: >> >> Hello, >> >> I had the following: one extended DropDownChoice with different languages >> and some fields in a form. When the user changes it, I get success in >> getting the translation of everything in the page, and also Wicket >> maintains >> whatever the user wrote in the fields, so it's nice. But I have a problem >> with one DropDownChoice which cointains countries. >> By default, it show the english names of all the countries in the world. >> In >> the onSelectionChanged of the languages DropDownChoice I reload the >> country >> names from the database, and make the following: >> >> countries = new DropDownChoice("country", getCountries()); >> userInformationForm.replace(countries); >> >> It works, at the same time I change the language, I get the country list >> in >> that language, but if the user selected one country, I can't maintain his >> selection... >> >> Any ideas? It should be easy as long as the ID of the country is the >> same... >> >> Thank you very very much for your help, >> Oskar >> >> -- >> View this message in context: >> http://www.nabble.com/Internationalization-and-DropDownChoice-tf3485705.html#a9731005 >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> 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 >> Wicket-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > > -- > Learn Wicket at ApacheCon Europe: http://apachecon.com > Join the wicket community at irc.freenode.net: ##wicket > Wicket 1.2.5 will keep your server alive. Download Wicket now! > http://wicketframework.org > > ------------------------------------------------------------------------- > 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 > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- View this message in context: http://www.nabble.com/Internationalization-and-DropDownChoice-tf3485705.html#a9746837 Sent from the Wicket - User mailing list archive at Nabble.com. ------------------------------------------------------------------------- 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 Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user