You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nick Busey <nb...@me.dium.com> on 2007/11/14 01:13:05 UTC
CheckGroup not selecting according to model
So I've got an object called ExternalContact with a selected Boolean and
corresponding getters and setters.
ExternalContact contact = (ExternalContact) item.getModelObject();
contact.setSelected(true);
Check check = new Check("selected", new Model(contact));
However my check boxes are not being output checked as they should. They are
unselected, and a dom inspection shows they are, in fact, not selected.
ExternalContact contact = (ExternalContact) item.getModelObject();
contact.setSelected(true);
Check check = new Check("selected", new PropertyModel(contact, "selected"));
Doesn't work either. Any thoughts?
--
View this message in context: http://www.nabble.com/CheckGroup-not-selecting-according-to-model-tf4801412.html#a13737526
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: CheckGroup not selecting according to model
Posted by Nick Heudecker <nh...@gmail.com>.
The CheckGroup model needs to have the collection of objects you want
checked, not the Check object.
On Nov 13, 2007 6:13 PM, Nick Busey <nb...@me.dium.com> wrote:
>
> So I've got an object called ExternalContact with a selected Boolean and
> corresponding getters and setters.
>
> ExternalContact contact = (ExternalContact) item.getModelObject();
> contact.setSelected(true);
> Check check = new Check("selected", new Model(contact));
>
> However my check boxes are not being output checked as they should. They
> are
> unselected, and a dom inspection shows they are, in fact, not selected.
>
> ExternalContact contact = (ExternalContact) item.getModelObject();
> contact.setSelected(true);
> Check check = new Check("selected", new PropertyModel(contact,
> "selected"));
>
> Doesn't work either. Any thoughts?
> --
> View this message in context:
> http://www.nabble.com/CheckGroup-not-selecting-according-to-model-tf4801412.html#a13737526
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Nick Heudecker
Professional Wicket Training & Consulting
http://www.systemmobile.com
Eventful - Intelligent Event Management
http://www.eventfulhq.com