Hi,

in case of a regular session you can use a HttpSessionListener and use the 
public void sessionDestroyed(HttpSessionEvent event), similar to that one here:
https://stackoverflow.com/questions/7756054/how-to-call-a-method-before-the-session-object-is-destroyed
(wicket is still a java framework, meaning all underlying java web things 
usually just work)

Also AFAIK the page should not get detached as long as the page is still 
active, meaning it has AJAX panels on it that are still doing things, maybe 
MartinG can shed some light on this;

Best,

KB


----- Ursprüngliche Mail -----
> Von: "yvus" <yves.courvois...@enata.com>
> An: users@wicket.apache.org
> Gesendet: Mittwoch, 26. September 2018 08:52:18
> Betreff: Re: Demo Page with User Related Data

> Hi,
> 
> Thanks for your answer. From reading your answer and the one of KB, I have
> the feeling that the best place to be sure that the pointers get deleted is
> to follow your suggestion: creation in Page#onConfigure, deletion in
> Page#onDetach. BUT imagine I have a panel in my page in which I have an Ajax
> request. Therefore, if I am not mistaken, I would
> - either have to call the pointers construction again in the
> Panel#onConfigure, but that would lead to duplicates of the pointers (which
> I don't want),
> - either keep the pointers the same as in the Parent page, but then the
> parent page onDetach would kill them. And hence my Ajax request in the panel
> would have no access to the pointers, correct?
> 
> Following your leads I would then propose to override a
> LoadableDetachableModel that would generate the pointers in the onAttach and
> delete them in the onDetach. This would imply many re-creation of the
> pointers though...
> 
> In your second suggestion, you provide a way to keep the pointers alive
> during the Http Session, but this is the case for which we don't know when
> to delete the pointers, correct?
> 
> Thanks again
> 
> 
> 
> --
> Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to