[ 
http://issues.apache.org/jira/browse/WICKET-175?page=comments#action_12459662 ] 
            
Johan Compagner commented on WICKET-175:
----------------------------------------

we already had a save guard in page:

        public void internalDetach()
        {
                if (attached)
                {
                        super.internalDetach();
                        attached = false;
                }
        }

That was requested by martijn. (see other bug about detached called to many 
times)
but then martijn itself rolled it back again for WICKET-112
And i already warned this would be happening.... that the boolean did also 
prevent components from detaching that where "outside" of the page touched.

But ComponentResourceRequestTarget is just wrong in this method:

        public void detach(RequestCycle requestCycle)
        {
                page.internalDetach();
        }

It just calls page.internalDetach() without an attach call first. So you can 
call detach on page but don't want an attach..
I think it should call detach directy on the component not on the page.



> Page.onDetach is called by each ComponentResourceRequestTarget
> --------------------------------------------------------------
>
>                 Key: WICKET-175
>                 URL: http://issues.apache.org/jira/browse/WICKET-175
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 2.0, 1.3
>            Reporter: Alastair Maw
>
> ComponentResourceRequestTarget#detach(RequestCycle) calls 
> page#internalDetach()
> This results in Page#onDetach() being called as many times as there are 
> images or whatever on your page, which seems entirely wrong. Mentioned this 
> to ivaynberg on IRC and he said: "we should have theadlocal guards".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to