[ http://issues.apache.org/jira/browse/WICKET-4?page=comments#action_12453531 ] Martin Benda commented on WICKET-4: -----------------------------------
Hi! I have got a similar problem with current 2.0-SNAPSHOT (updated form svn repo before two hours) that may be related to this bug: When a Form on page A is submitted and the response page is set to page B (via setResponsePagec(B.class) in the Form#onSubmit() method), the onAttach, onDetach etc. methods of page A are not called - as a consequence, the form model, which was updated (and attached) as a result of form submit, is not detached at the end of the request. I have created a simple test case: http://sucker.pilsfree.net/wicket-detach.tar.gz -- IndexPage entered -- 27.11.2006 10:09:35 com.cleverlance.wicketdetach.IndexPage onAttach INFO: onAttach 27.11.2006 10:09:35 com.cleverlance.wicketdetach.IndexPage onDetach INFO: onDetach -- FormPage entered -- 27.11.2006 10:11:09 com.cleverlance.wicketdetach.FormPage onAttach INFO: onAttach 27.11.2006 10:11:09 com.cleverlance.wicketdetach.SimpleModel detach INFO: detaching Model:classname=[com.cleverlance.wicketdetach.SimpleModel]:[EMAIL PROTECTED] 27.11.2006 10:11:09 com.cleverlance.wicketdetach.SimpleModel detach INFO: detaching Model:classname=[com.cleverlance.wicketdetach.SimpleModel]:[EMAIL PROTECTED] 27.11.2006 10:11:09 com.cleverlance.wicketdetach.SimpleModel detach INFO: detaching Model:classname=[com.cleverlance.wicketdetach.SimpleModel]:[EMAIL PROTECTED] 27.11.2006 10:11:09 com.cleverlance.wicketdetach.FormPage onDetach INFO: onDetach -- "Submit" clicked -- 27.11.2006 10:11:32 com.cleverlance.wicketdetach.FormPage$1 onSubmit INFO: form submitted 27.11.2006 10:11:32 com.cleverlance.wicketdetach.FormPage onAttach INFO: onAttach 27.11.2006 10:11:32 com.cleverlance.wicketdetach.SimpleModel detach INFO: detaching Model:classname=[com.cleverlance.wicketdetach.SimpleModel]:[EMAIL PROTECTED] 27.11.2006 10:11:32 com.cleverlance.wicketdetach.SimpleModel detach INFO: detaching Model:classname=[com.cleverlance.wicketdetach.SimpleModel]:[EMAIL PROTECTED] 27.11.2006 10:11:32 com.cleverlance.wicketdetach.SimpleModel detach INFO: detaching Model:classname=[com.cleverlance.wicketdetach.SimpleModel]:[EMAIL PROTECTED] 27.11.2006 10:11:32 com.cleverlance.wicketdetach.FormPage onDetach INFO: onDetach -- "Submit & Return" clicked -- 27.11.2006 10:11:59 com.cleverlance.wicketdetach.FormPage$1 onSubmit INFO: form submitted 27.11.2006 10:11:59 com.cleverlance.wicketdetach.IndexPage onAttach INFO: onAttach 27.11.2006 10:11:59 com.cleverlance.wicketdetach.IndexPage onDetach INFO: onDetach > Page.onBeginRequest() [and consequently .onAttach()] not called when form on > page is submitted. > ----------------------------------------------------------------------------------------------- > > Key: WICKET-4 > URL: http://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 > Priority: Critical > Fix For: 2.0, 1.3 > > > 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. - 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
