The Wicket 1.4 RequestCycle also provided 3 'onFinish' methods: detach, onAfterTargetsDetached and onEndRequest, which were invoked in that order. Perhaps, the solution is to move onEndRequest back to its old position, after onDetach? It used to be a method that was called at the very end of the request, even after the pagemap lock was released.
On Monday 13 June 2011 21:19:31 Martin Grigorov wrote: > -0 > > I also don't like having so much "onFinish" methods (currently there > are onEndRequest() and onDetach()). > I also suggested to Emond in IRC to extend RequestCycle class (option > b) below) but now I think he will need to tweak BaseWicketTester > because it has its own RequestCycle and this may be tricky. > But even with this reason I still don't like to have three step on-finish. > > On Mon, Jun 13, 2011 at 10:04 PM, Igor Vaynberg <[email protected]> wrote: > > -0 > > > > like i said in jira, > > a) it is dangerous to provide a method that is called after detach() > > because it can potentially reattach state. a lot more people are > > familiar with "destroy" rather then "detach" so without reading > > javadoc that seems like a better method to override - which is > > incorrect. > > b) this can still be accomplished by subclassing requestcycle's > > detach() and calling super first in the override. > > > > -igor > > > > > > On Mon, Jun 13, 2011 at 11:54 AM, Martijn Dashorst > > > > <[email protected]> wrote: > >> +1 > >> > >> On Fri, Jun 10, 2011 at 10:52 AM, Emond Papegaaij > >> > >> <[email protected]> wrote: > >>> Hi all, > >>> > >>> With the migration from Wicket 1.4 to 1.5, we tried to rewrite our > >>> custom request cycle code into IRequestCycleListeners. This worked for > >>> most of our code, except for one use-case: running code after > >>> everything is detached. In Wicket 1.4, it was possible to use the > >>> onAfterTargetsDetached for this, but a similar method is not available > >>> in IRequestCycleListener. > >>> > >>> I opened a ticket for this (WICKET-3695), but it was closed by Igor. > >>> After a bit of discussion (see the issue), he suggested to start a > >>> vote here; so here it is. We would like the addition of onDestroy to > >>> IRequestCycleListener, which is called after everything is detached. > >>> This would serve to tear down request state that is still needed > >>> during detaching. > >>> > >>> Best regards, > >>> Emond Papegaaij > >> > >> -- > >> Become a Wicket expert, learn from the best: http://wicketinaction.com
