Check that CloudService #equals() and #hashCode() are properly implemented.
And please, ask such kind of questions in users@ mailing list. On Fri, Feb 24, 2012 at 2:38 PM, mjop <[email protected]> wrote: > Hello Everyone, > > I'm currently using DropDownChoice in my class but it unfortunately doesn't > work properly. > When I give it model which has already set value the DropDown doesn't > indicating the selected value on the rendered page. There's still "Choose > One" option selected. > My class: > > public class AddProfile<T extends Profile> extends Panel { > > (...) > > private final IModel<List<T>> profilesListModel; > > private final ChoiceRenderer<Profile> profileRenderer = new > ChoiceRenderer<Profile>( > "name", "id"); > > public AddProfile(final CloudService selectedService, > final ModalWindow modal, final Class<T> profileType) { > > super(modal.getContentId()); > > profilesListModel = new LoadableDetachableModel<List<T>>() { > private static final long serialVersionUID = > 7058071564604627833L; > > @Override > protected List<T> load() { > return profileDao.get(profileType, (User) SecurityUtils > .getSubject().getPrincipal()); > > } > }; > > (...) > > final WebMarkupContainer profilesListContainer = new WebMarkupContainer( > "profilesListContainer"); > profilesListContainer.setOutputMarkupPlaceholderTag(true); > add(profilesListContainer); > > Form<CloudService> form = new Form<CloudService>("form"); > profilesListContainer.add(form); > > DropDownChoice<T> displayProfilesList = new DropDownChoice<T>( > "displayProfilesList", new PropertyModel<T>(selectedService, > "profile"), profilesListModel, profileRenderer); > > displayProfilesList.setRequired(true); > form.add(displayProfilesList); > > (...) > } > > I think it can be something with the <T> generics because in the other place > in my app I use DropDownChoice with strictly specified generic like > <CloudService> and it works fine. > > Any advice is welcome. > Thank You! > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-doesn-t-indicating-previously-selected-value-from-Model-tp4417203p4417203.html > Sent from the Forum for Wicket Core developers mailing list archive at > Nabble.com. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com
