[
https://issues.apache.org/jira/browse/WICKET-4383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Grigorov resolved WICKET-4383.
-------------------------------------
Resolution: Not A Problem
> getPage() cannot be used in Form.onSubmit() if the page hierarchy changed in
> a submitting component's onSubmit()
> ----------------------------------------------------------------------------------------------------------------
>
> Key: WICKET-4383
> URL: https://issues.apache.org/jira/browse/WICKET-4383
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 1.5.4
> Reporter: Floris Kruisselbrink
> Priority: Minor
> Attachments: formsubmitbutton.zip
>
>
> I have a form, which wants to get information about it's place in the
> page-hierarchy in the Form.onSubmit() method (in reality wicket-security does
> this, but the attached quickstart demonstrates the problem without
> wicket-security)
> The form is submitted using an AjaxSubmitLink, which also has an onSubmit()
> method, in which the page hierarchy is changed in such a way the form is no
> longer there.
> The form's own onSubmit is called later on, and (as the form is not in the
> page hierarchy anymore) crashes while trying to call Form.getPage().
> This same construction worked fine when our application still used wicket 1.4
> I will attach a quickstart demonstrating the problem, see the comments in
> FormPanel.java
> ERROR - DefaultExceptionMapper - Unexpected error occurred
> org.apache.wicket.WicketRuntimeException: No Page found for component [
> [Component id = form]]
> at org.apache.wicket.Component.getPage(Component.java:1765)
> at
> nl.vloris.wicketbugs.formsubmitbutton.FormPanel$1.onSubmit(FormPanel.java:28)
> at org.apache.wicket.markup.html.form.Form$9.component(Form.java:1169)
> at org.apache.wicket.markup.html.form.Form$9.component(Form.java:1164)
> at
> org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:273)
> at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:244)
> at
> org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1162)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira