Did the field2 have an initial value or did you set the value in your
browser and then let the ajax run?

Hielke

On 21 Dec 2010 20:51, "eugenebalt" <eugeneb...@yahoo.com> wrote:
>
>
> I have a piece of Ajax code, attached to some field (let's call it
> sourceField), which looks like this:
>
>
> sourceField.add(new AjaxFormChoiceComponentUpdatingBehavior()
> {
>
>     protected void onUpdate(AjaxRequestTarget target)
>     {
>           target.addComponent(Field2);
>     }
> }
>
>
> As you can see, Field2 is not changed in any way, it is not cleared or
> modified (so this code shouldn't really do anything).
>
> However, when this Ajax runs on changing the sourceField, the Field2's
> values get erased! Field2 is actually a CheckBoxMultipleChoice, and all
the
> checkbox selections get erased as soon as I do target.addComponent().
>
> Why does this happen? Any ideas on what's causing this?
>
> (Field2 is a CheckBoxMultipleChoice, initially initialized with some list,
> and its outputMarkerId = true, to make it work with Ajax.)
>
> Thanks
> --
> View this message in context:
http://apache-wicket.1842946.n4.nabble.com/target-addComponent-Field-in-Ajax-erases-that-Field-s-values-tp3159543p3159543.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

Reply via email to