[ 
https://issues.apache.org/jira/browse/WICKET-4?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468949
 ] 

Johan Compagner commented on WICKET-4:
--------------------------------------

yes onAttach() and onBeforeRender is now purely for the render phase

onDetach() is called always so that models and components are detached 
correctly.
And detach() must be called even if (the current) attach is not called because 
of that.

So when you submit a form and then respond/render to another page 
the onAttach is not called for that page with that form. But detach is..

I think this is wrong and i already have said i think on the user list how it 
should be: (last night i really needed that onattach anyway that i now have 
found through IPageEntry...)


on submit request comes in respond to same page:

Page.onAttach();
form.onSubmit();
Page.onBeginRender();
Page.render();
Page.onEndRender();
Page.onDetach();


on submit request comes in respond to another page:

Page1.onAttach();
form.onSubmit();
Page2.onAttach();
Page2.onBeginRender();
Page2.render();
Page2.onEndRender();
Page2.onDetach();
Page.1onDetach();



> Page.onBeginRequest() [and consequently .onAttach()] not called when form on 
> page is submitted.
> -----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4
>                 URL: https://issues.apache.org/jira/browse/WICKET-4
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.2
>         Environment: os = OS X 10.4.8; java version = jre/jdk 1.5.0_06; 
> servlet container =  jetty-5.1.11RC0
>            Reporter: Paul Milovanov
>         Assigned To: Johan Compagner
>            Priority: Critical
>             Fix For: 1.3, 2.0
>
>
> Page.onBeginRequest() [and consequently .onAttach()] not called when form on 
> page is submitted. Form.onBeginRequest() is not called as well. However, 
> Page.onEndRequest()  and Form.onEndRequest() are called correctly.
> In more detail: 
> I have a page, FrontPage, and a form LoginForm on it (The form has 
> defaultFormProcessing = true)
> onBeginRequest(), onEndRequest() in FrontPage, LoginForm, are overriden as 
> follows:
>       protected void onBeginRequest() {
>               log.debug("request begin");
>               ...
>               super.onBeginRequest();
>       }
>       protected void onEndRequest() {
>               super.onEndRequest();
>               ...
>               log.debug("request end");
>       }
> So I load FrontPage, type in data into the form (that corr. to LoginForm) and 
> submit form.
> The log output is as follows
> //first load of page
> DEBUG <hotline.pages.FrontPage> request begin
> ...
> DEBUG <hotline.pages.FrontPage$LoginForm> request begin
> ...
> DEBUG <hotline.pages.FrontPage> request end 
> DEBUG <hotline.pages.FrontPage$LoginForm> request end
> ...
> //form submitted
> DEBUG <hotline.pages.FrontPage> request end
> DEBUG <hotline.pages.FrontPage$LoginForm> request end

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to