You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Andrew Schetinin <as...@gmail.com> on 2011/10/31 21:28:36 UTC

Stale models in a form with a lot of AJAX

Hi,

I have a form that contains a complex object in a model, and I pass that
model to several panels within the form.
Various components on the panels may invoke AJAX calls and update pieces of
that object, and then update other controls to reflect the changes.

What happens is that one drop-down lists updates the object when another
item is selected in the list.
I see the change in the object. Then, in the same handler, the other panels
are targeted to be updated.
But when I get to onInitialize() of those  panels, I see an old copy of the
object, without any updates.

I have a suspicion that AJAX calls somehow navigate to an old copy of the
form, and I get old copies of the serialized object.
Is it possible that this is the case?
How to workaround it?
Is there another way to work with the model so that it does not get stale?

Note that I would not like to use LDM since persisting the model on every
small change is too heavy.

Regards,

Andrew

-- 
--
Andrew Schetinin

Re: Stale models in a form with a lot of AJAX

Posted by Andrew Schetinin <as...@gmail.com>.
Hi again,

Sorry, it looks like the model object got assigned to an old copy along the
road, so there is no any problem with the models.

Regards,

Andrew

On Mon, Oct 31, 2011 at 10:28 PM, Andrew Schetinin <as...@gmail.com>wrote:

> Hi,
>
> I have a form that contains a complex object in a model, and I pass that
> model to several panels within the form.
> Various components on the panels may invoke AJAX calls and update pieces
> of that object, and then update other controls to reflect the changes.
>
> What happens is that one drop-down lists updates the object when another
> item is selected in the list.
> I see the change in the object. Then, in the same handler, the other
> panels are targeted to be updated.
> But when I get to onInitialize() of those  panels, I see an old copy of
> the object, without any updates.
>
> I have a suspicion that AJAX calls somehow navigate to an old copy of the
> form, and I get old copies of the serialized object.
> Is it possible that this is the case?
> How to workaround it?
> Is there another way to work with the model so that it does not get stale?
>
> Note that I would not like to use LDM since persisting the model on every
> small change is too heavy.
>
> Regards,
>
> Andrew
>
> --
> --
> Andrew Schetinin
>



-- 
--
Andrew Schetinin