You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eugenebalt <eu...@yahoo.com> on 2011/04/05 19:57:06 UTC

Pre-Select CheckBox in CheckBoxMultipleChoice?

I have a CheckBoxMultipleChoice with some checkboxes.

I also have a String, X. If there is a checkbox in the list whose title
matches X, then I have to pre-select it (select it in the model).

Any idea how to do that? Thanks

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pre-Select-CheckBox-in-CheckBoxMultipleChoice-tp3428739p3428739.html
Sent from the Users forum 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: Pre-Select CheckBox in CheckBoxMultipleChoice?

Posted by eugenebalt <eu...@yahoo.com>.
Ok. thanks

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pre-Select-CheckBox-in-CheckBoxMultipleChoice-tp3428739p3428823.html
Sent from the Users forum 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: Pre-Select CheckBox in CheckBoxMultipleChoice?

Posted by Martin Grigorov <mg...@apache.org>.
(03:10:56 PM) pedrosans_: Hi, my reply in the users mailing list got
rejected again :S
(03:11:47 PM) pedrosans_: can someone reply Alexander for me?
(03:12:00 PM) pedrosans_: thread: Pre-Select CheckBox in
CheckBoxMultipleChoice?
(03:12:12 PM) pedrosans_: my reply: It is important to notify model changes
to components when we are responding a form submit for instance, because the
form component needs to have a change to cleanup the raw input in benefit of
the new value in the model. As in this usecase we want to pre-select a
value, modelChanged call is useless because we are rather initializing a
model than changing it.
(03:12:19 PM) pedrosans_: thanks!

On Wed, Apr 6, 2011 at 4:11 AM, Alexander Morozov <
alexander.v.morozov@gmail.com> wrote:

> Pedro,
>
> should we notify multipleChoiceModel that model is changed ?
> checkBoxMultipleChoiceComponent.setDefaultModel( multipleChoiceModel  );
> multipleChoiceModel.getObject().add( X );
> multipleChoiceModel.modelChanged();
>
>
> Pedro Santos wrote:
> >
> > add X in the CheckBoxMultipleChoice model collection. e.g.
> >
> > IModel&lt;Collection&gt; multipleChoiceModel = (...);
> > checkBoxMultipleChoiceComponent.setDefaultModel( multipleChoiceModel  );
> > multipleChoiceModel.getObject().add( X );
> >
> >
> > On Tue, Apr 5, 2011 at 2:57 PM, eugenebalt &lt;eugenebalt@yahoo.com&gt;
> > wrote:
> >
> > &gt; I have a CheckBoxMultipleChoice with some checkboxes.
> > &gt;
> > &gt; I also have a String, X. If there is a checkbox in the list whose
> > title
> > &gt; matches X, then I have to pre-select it (select it in the model).
> > &gt;
> > &gt; Any idea how to do that? Thanks
> > &gt;
> > &gt; --
> > &gt; View this message in context:
> > &gt;
> >
> http://apache-wicket.1842946.n4.nabble.com/Pre-Select-CheckBox-in-CheckBoxMultipleChoice-tp3428739p3428739.html
> > &gt; Sent from the Users forum mailing list archive at Nabble.com.
> > &gt;
> > &gt;
> ---------------------------------------------------------------------
> > &gt; To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > &gt; For additional commands, e-mail: users-help@wicket.apache.org
> > &gt;
> > &gt;
> >
> >
> > --
> > Pedro Henrique Oliveira dos Santos
> >
>
>
> -----
> --
> http://www.linkedin.com/in/amorozov
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Pre-Select-CheckBox-in-CheckBoxMultipleChoice-tp3428739p3429710.html
> Sent from the Users forum 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
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Pre-Select CheckBox in CheckBoxMultipleChoice?

Posted by Alexander Morozov <al...@gmail.com>.
Pedro,

should we notify multipleChoiceModel that model is changed ?
checkBoxMultipleChoiceComponent.setDefaultModel( multipleChoiceModel  );
multipleChoiceModel.getObject().add( X );
multipleChoiceModel.modelChanged();


Pedro Santos wrote:
> 
> add X in the CheckBoxMultipleChoice model collection. e.g.
> 
> IModel&lt;Collection&gt; multipleChoiceModel = (...);
> checkBoxMultipleChoiceComponent.setDefaultModel( multipleChoiceModel  );
> multipleChoiceModel.getObject().add( X );
> 
> 
> On Tue, Apr 5, 2011 at 2:57 PM, eugenebalt &lt;eugenebalt@yahoo.com&gt;
> wrote:
> 
> &gt; I have a CheckBoxMultipleChoice with some checkboxes.
> &gt;
> &gt; I also have a String, X. If there is a checkbox in the list whose
> title
> &gt; matches X, then I have to pre-select it (select it in the model).
> &gt;
> &gt; Any idea how to do that? Thanks
> &gt;
> &gt; --
> &gt; View this message in context:
> &gt;
> http://apache-wicket.1842946.n4.nabble.com/Pre-Select-CheckBox-in-CheckBoxMultipleChoice-tp3428739p3428739.html
> &gt; Sent from the Users forum mailing list archive at Nabble.com.
> &gt;
> &gt; ---------------------------------------------------------------------
> &gt; To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> &gt; For additional commands, e-mail: users-help@wicket.apache.org
> &gt;
> &gt;
> 
> 
> -- 
> Pedro Henrique Oliveira dos Santos
> 


-----
--
http://www.linkedin.com/in/amorozov
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pre-Select-CheckBox-in-CheckBoxMultipleChoice-tp3428739p3429710.html
Sent from the Users forum 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: Pre-Select CheckBox in CheckBoxMultipleChoice?

Posted by Pedro Santos <pe...@gmail.com>.
add X in the CheckBoxMultipleChoice model collection. e.g.

IModel<Collection> multipleChoiceModel = (...);
checkBoxMultipleChoiceComponent.setDefaultModel( multipleChoiceModel  );
multipleChoiceModel.getObject().add( X );


On Tue, Apr 5, 2011 at 2:57 PM, eugenebalt <eu...@yahoo.com> wrote:

> I have a CheckBoxMultipleChoice with some checkboxes.
>
> I also have a String, X. If there is a checkbox in the list whose title
> matches X, then I have to pre-select it (select it in the model).
>
> Any idea how to do that? Thanks
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Pre-Select-CheckBox-in-CheckBoxMultipleChoice-tp3428739p3428739.html
> Sent from the Users forum 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
>
>


-- 
Pedro Henrique Oliveira dos Santos