Dont share models between pages if possible.

This is also a problem if 1 or both of them is serialized and then
read back in, then you suddenly have 2 instances because pages are not
serialized as one thing.



On 03/07/2009, Martijn Dashorst <[email protected]> wrote:
> In our apps we (wrongfully IMO) make heavily use of ModalWindow (our
> users seem to like them). We ran into an issue/race condition where we
> have shared a model between the calling page and the ModalWindow. We
> have an autocomplete textfield with an onblur handler attached. This
> onblur handler is triggered when the modal window is shown resulting
> in two parallel Ajax requests to the server. This causes the shared
> model to be attached and detached at the same time, resulting in
> rather funky behavior.
>
> I know that one solution is to not share the model between the
> ModalWindow and the calling page. But we are looking for alternative
> (more general) solutions.
>
> Options we thought of:
>  - would locking the session for page directed requests implementable
> (i.e. let resource requests through the barrier, but not both requests
> to the calling page and the modalwindow page)
>  - would it work to set a client side flag when the ModalWindow is
> requested, that disables wicket-ajax for the current window to happen
> (preventing the onblur to trigger Ajax), and is reset when the
> ModalWindow is rendering in the client?
>  - render the modalwindow page in the current pagemap instead of a new
> one (would make refresh behavior pretty weird I think)
>
> Any other suggestions?
>
> Martijn
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to