On 3/26/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
The onDetach sematics would be defined something like this:
The method is called on the end of request, even if the component was
not attached.
The detach methods are usually rather simple, so I really don't think
there would be a big performance penalty, as we already need to
traverse the component tree.

If we can make it so that they are only called just once per request I
think it would be an improvement.

I think this is the right thing to do: the following case is quite typical:

public MyPage extends Page {
   IModel someModel;
   /* ... */
   void onDetach() {
       someModel.detach();
   }
}

Now if some model is attached during an Ajax request, I remember that
the ondetach of the page is not called (at least not some time ago),
causing serialization errors.

Hmm. Thinking of this... can't we trigger detachment on serialization?
We already go through the component tree there...

Martijn

--
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.5 will keep your server alive. Download Wicket now!
http://wicketframework.org

Reply via email to