It is not bad per se, but it seems to me a symptom of a not well defined request cycle in terms of detach operations.
And for a large component hierarchy, this can be somewhat expensive, especially if you have two pages participating in a request (then you have 4 detaches). If we don't have to do it twice or thrice, then I'd rather not do so. Martijn On 1/5/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
Is it really that bad to have multiple detach calls that we need another flag? My detach code usually is object = null; or if (nestedModel != null) nestedModel.detach(), or something alike. -Matej Igor Vaynberg wrote: > im fine with having the detached flag, but where do we reset it? in > touch()? > > -igor > > > On 1/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote: >> >> we already do that >> But the SecondLevelCache also calles detach! It has to do that.. >> Or we have to change that that the touch of the page (that pushes the >> page >> into the session) >> doesn't happen before the detach of the RequestCycle. >> But that is ugly >> >> Thats why we get double detach calls in normal page requests >> >> And then we still have ajax i guess where also loads of detach problems >> where happening i believe? >> >> I don't mind double detach calls. we also can say that can happen. >> Then we >> don't need the is attached flag >> But there was a bug report for that... >> >> johan >> >> >> On 1/5/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: >> > >> > i think its simpler then that. we keep a stack of request targets used, >> so >> > at the end of the request cycle we just need to go through the stack >> and >> > call detach on each request target. >> > >> > -igor >> > >> > >> > >> > On 1/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote: >> > > >> > > > >> > > > this should be enough (IMHO): >> > > > >> > > > >> 1) resolve link component >> > > > >> 2) invoke onclick (internal methods of the component) >> > > > >> 3) invoke onbeforerender >> > > > >> 4) invoke render >> > > > >> 5) invoke onafterrender >> > > >> > > >> > > >> > > this doesn't work >> > > >> > > >> 1) resolve link component (page1) >> > > >> 2) invoke onclick (page1) (internal methods of the component) >> > > >setResponsePage(Page2) >> > > >> 3) invoke onbeforerender (Pag2) >> > > >> 4) invoke render (Page2) >> > > >> 5) invoke onafterrender (Page2) >> > > >> > > >> > > Aaarghh Page1 will still be in a attached state!!...... >> > > >> > > >> > > the complete picture can be this: >> > > >> > > > >> 1) resolve link component (page1) >> > > > >> 2) invoke onattach (Page1) >> > > > >> 3) invoke onclick (Page1) >> > > > >> 2) invoke onattach (Page2) >> > > > >> 4) invoke onbeforerender (Page2) >> > > > >> 5) invoke render (Page2) >> > > > >> 6) invoke onafterrender (Page2) >> > > > >> 7) invoke ondetach (Page2) >> > > > >> 7) invoke ondetach (Page1) >> > > >> > > thats the complete picture that has to be taken into account. >> > > >> > > But onAttach can be just an attach method that is public or maybe >> > > protected >> > > final >> > > And is only used to set the IS_ATTACHED_FLAG to true on the complete >> > > component hierarchy. >> > > >> > > johan >> > > >> > > >> > >> > >> >> >
-- Vote for Wicket at the http://www.thebeststuffintheworld.com/vote_for/wicket Wicket 1.2.4 is as easy as 1-2-4. Download Wicket now! http://wicketframework.org
