[ 
https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689063#action_12689063
 ] 

Johan Compagner commented on WICKET-2150:
-----------------------------------------

cant you abstract it a bit then?
Because  panels dont reallyhave to know about wizards
But the wizards know about the panels so wizard.applyState() calls 
panel.mySpecialSubmit()
and in your nested forms that you have in your panels (i guess thats the whole 
point here) have a just a configuration that they know that they dont have to 
do onsubmit?

But you can also fix it the other way
You have control over all the forms because the wizard form and the nested 
forms are all your code
Just let them all extend a base PublicSumbitForm that extends the normal form
that has a public submit method.

then in your 
protected void delegateSubmit(IFormSubmittingComponent submittingComponent) 

just cast to that PublicSubmitForm and call the onSubmit()
And if you cant cast throw an exception..

Then it also works just fine in 1.3

> Wizard executes onSubmit() of wrong nested form
> -----------------------------------------------
>
>                 Key: WICKET-2150
>                 URL: https://issues.apache.org/jira/browse/WICKET-2150
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.3.5, 1.4-RC2
>            Reporter: Dave Schoorl
>             Fix For: 1.3.6, 1.4-RC3
>
>         Attachments: wizard-onsubmit.zip, wizard-patch-1.3.x.txt, 
> wizard-patch-1.4.x.txt, wizard-patch-revised-1.3.x.txt
>
>
> When you have a wizard and the steps in the wizard contain nested forms, the 
> onSubmit() of the next - instead of the current - step's nested form is 
> executed. This is caused by the fact that during the advancing of step A to 
> step B, first the view of A is replaced with the view of B on the wizard's 
> form, and after that, the form's (and nested form's) onSubmit() is called, 
> incorrectly calling the onSubmit() of view B.
> The swapping of the view should happen after the wizard's form (and nested 
> forms) onSubmit() has been called.

-- 
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