http://steve-on-sakai.blogspot.com/2008/12/using-hashmap-with-dropdownchoice.html

-igor

On Wed, Aug 19, 2009 at 3:17 PM, Eirik Lygre<eirik.ly...@gmail.com> wrote:
> I'm looking for the best way to implement a drop-down, where the type of the
> model property is not the type of the lists:
>
> For example, with the model below, I want to implement a drop-down to select
> languages for a user.
>
>    class User {
>        String languageId;
>    }
>
>    class Language {
>        String languageId;
>        String languageName;
>    }
>
>    // From MyForm extends Form<User>
>    // here, this.getModelObject returns a User
>    // Somewhere in the constructor...
>    ...
>    List<Language> languages = getLanguagesFromDatabase();
>    form.add (new DropDownChoice("languageDropDown", ...eh...?
>    ...
>
> My workaround involves creating a separate model for the language, and copy
> from the language model to the user model whenever I use the user model. But
> it's cumbersome...
>
> 1) Is there a better way?
> 2) Is there an established "best practice" for this (probaly common)
> scenario?
>
>
> Eirik
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to