You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Dave Schoorl (JIRA)" <ji...@apache.org> on 2009/03/07 18:22:56 UTC
[jira] Created: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
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.4-RC2, 1.3.5
Reporter: Dave Schoorl
Fix For: 1.3.6, 1.4-RC3
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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689046#action_12689046 ]
Johan Compagner commented on WICKET-2150:
-----------------------------------------
Ok i didnt know the wizard from top of my head but i looked at it and yes it is what i told yesterday.
If you use buttons you shouldnt use the Form.onsubmit() because mixing those is a bit weird. You can do that ofcourse if you really want, but better is if you use buttons use buttons all the way.
And the wizard is build like that. Because i dont know what you exactly want to do in Form.onSubmit()
But it sounds to me that you should do what you do there in IWizardStep.applyState() thats the method that should do it stuff before the next button will set the next page.
just look at the code:
public final void onClick()
{
IWizardModel wizardModel = getWizardModel();
IWizardStep step = wizardModel.getActiveStep();
// let the step apply any state
step.applyState();
// if the step completed after applying the state, move the
// model onward
if (step.isComplete())
{
wizardModel.next();
thats the onclick of the next button. So first it calls applyState() where you can do your stuff that you would do in onSubmit()
Then you also can stop it from going to the next (validation failure)
But that said, i am not really against making onSubmit public, buttons also have a public onsubmit so to have that is fine by me.
But we cant change that for 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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688942#action_12688942 ]
Johan Compagner commented on WICKET-2150:
-----------------------------------------
i looked at the code but you can already do this
Just override the:
protected void delegateSubmit(IFormSubmittingComponent submittingComponent)
and do your own order of onSubmit calling
> 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
>
>
> 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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg updated WICKET-2150:
----------------------------------
Fix Version/s: (was: 1.4-RC6)
1.5-M1
we cannot apply this fix because it will change existing behavior.
i also thought about moving the code out of button's onsubmit and into the wizard form's onsubmit(), but the form is also produced by an overridable factory so unless users call super.onsubmit() - and most do not - it will change behavior.
we will have to wait for 1.5 to properly fix it, and hopefully finally make the switch so that form's onsubmit is called before button's onsubmit everywhere!
> 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.5-M1
>
> Attachments: wizard-onsubmit.zip, wizard-patch-1.3.x.txt, wizard-patch-1.4.x.txt, wizard-patch-revised-1.3.x.txt, wizard-patch-revised-1.4.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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeremy Thomerson updated WICKET-2150:
-------------------------------------
Fix Version/s: (was: 1.4-RC4)
1.4-RC5
> 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.4-RC5
>
> Attachments: wizard-onsubmit.zip, wizard-patch-1.3.x.txt, wizard-patch-1.4.x.txt, wizard-patch-revised-1.3.x.txt, wizard-patch-revised-1.4.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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689194#action_12689194 ]
Igor Vaynberg commented on WICKET-2150:
---------------------------------------
yes, we should be going from most general to most specific - which is the order you proposed.
> 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, wizard-patch-revised-1.4.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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Dave Schoorl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dave Schoorl updated WICKET-2150:
---------------------------------
Attachment: wizard-patch-1.4.x.txt
For 1.4.x branch a patch is attached.
This is basically the same patch as for 1.3.x, only the onSubmit() of IFormSubmittingComponent has been renamed to beforeFormOnSubmit(). THIS BREAKS BACKWARDS COMPATIBILITY.
If this patch is applied, a note must also be included in the 1.4 migration guide.
> 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
>
>
> 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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg updated WICKET-2150:
----------------------------------
Fix Version/s: 1.5-M2
(was: 1.5-M1)
> 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.5-M2
>
> Attachments: wizard-onsubmit.zip, wizard-patch-1.3.x.txt, wizard-patch-1.4.x.txt, wizard-patch-revised-1.3.x.txt, wizard-patch-revised-1.4.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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Dave Schoorl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689056#action_12689056 ]
Dave Schoorl commented on WICKET-2150:
--------------------------------------
That would be great when Form#onSubmit is public in 1.4. I will have to speedup the switch to 1.4 then.
applyState is of no use to me in this case. It is Wizard specific and I want to reuse panels with nested forms with form#onSubmit implementations that I already use on normal pages. These panels are unaware if they are on a normal page or in a Wizard. So it is about facilitating component reuse I guess.
I will supply a 1.4 patch later today.
Thanks.
> 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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeremy Thomerson updated WICKET-2150:
-------------------------------------
Fix Version/s: (was: 1.4-RC5)
1.4-RC6
> 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.4-RC6
>
> Attachments: wizard-onsubmit.zip, wizard-patch-1.3.x.txt, wizard-patch-1.4.x.txt, wizard-patch-revised-1.3.x.txt, wizard-patch-revised-1.4.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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689033#action_12689033 ]
Johan Compagner commented on WICKET-2150:
-----------------------------------------
you should be able to call Form,onSubmit() just fine
its a protected method of Form (so callable from a subclass) and you create a subclass by extending the form to override delegateSubmit()
so this compiles fine at myplace:
/**
* @see org.apache.wicket.markup.html.form.Form#delegateSubmit(org.apache.wicket.markup.html.form.IFormSubmittingComponent)
*/
@Override
protected void delegateSubmit(IFormSubmittingComponent submittingComponent)
{
onSubmit();
}
and i you want to call another forms onSubmit() there then just override that form also and make the onSubmit public (and cast to that form)
> 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
>
>
> 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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689166#action_12689166 ]
Igor Vaynberg commented on WICKET-2150:
---------------------------------------
sigh, ive always campaigned that the call order is just wrong. it should be form.onsubmit() followed by button.onsubmit(). we put more specific processing into the button so it should be called last. oh well, maybe i will start another flamewar on the list when its time for 1.5
> 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, wizard-patch-revised-1.4.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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Dave Schoorl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679899#action_12679899 ]
Dave Schoorl commented on WICKET-2150:
--------------------------------------
A possible solution is to make the flow of onSubmit configurable: do you want the onSubmit of IFormSubmittingComponent be triggered before or after the Form's onSubmit(). This would retain backwards compatibility when the default is set to 'before'. The form of the wizard can then be configured to execute the IFormSubmittingComponent's onSubmit() after the form's onSubmit().
A nicer solution would be to replace the onSubmit() of IFormSubmittingComponent into beforeFormOnSubmit() and afterFormOnSubmit(), but of course, this would break backwards compatibility and is not advisable for 1.3.x release. For 1.4 release this could be an option.
> 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
>
>
> 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.
[jira] Resolved: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-2150.
-----------------------------------
Assignee: Igor Vaynberg
Resolution: Fixed
> 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
> Assignee: Igor Vaynberg
> Fix For: 1.5-M2
>
> Attachments: wizard-onsubmit.zip, wizard-patch-1.3.x.txt, wizard-patch-1.4.x.txt, wizard-patch-revised-1.3.x.txt, wizard-patch-revised-1.4.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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689181#action_12689181 ]
Johan Compagner commented on WICKET-2150:
-----------------------------------------
i am fine with that also
And i dont think but i could be wrong that there are not many people who are mixing the 2 submits anyway.
But what is then the best order?
form.submit()
nestedforms.submit()
button.submit()
?
> 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, wizard-patch-revised-1.4.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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Dave Schoorl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689032#action_12689032 ]
Dave Schoorl commented on WICKET-2150:
--------------------------------------
@Jeremy: It is not similar to WICKET-2063 and I think it is also not related, because caching is not an issue with WICKET-2150.
@Johan: This was my first approach, but when I override delegateSubmit(IFormSubmittingComponent submittingComponent), my overriden method cannot call Form.onSubmit() because it is not visible. Form.onSubmit() must be changed to public for this to work. Is it okay to change the visibility to public?
> 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
>
>
> 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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Dave Schoorl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dave Schoorl updated WICKET-2150:
---------------------------------
Attachment: wizard-onsubmit.zip
The quickstart project in the attachement 'wizard-onsubmit.zip' demonstrates the problem.
Run it and click through the wizard. The log will show entries of views being displayed and nested form's onSubmit() being called.
When you are on step A, advance to step B. The logfile will first show that Panel B is displayed and then that the onSubmit() of nested form B is called. This is wrong. The onSubmit() of nested form A should have been called.
> 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
>
>
> 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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Dave Schoorl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dave Schoorl updated WICKET-2150:
---------------------------------
Attachment: wizard-patch-revised-1.3.x.txt
Yes, but I need to override the Wizard's newForm methods like this:
/**
* Create a new form. Clients can override this method to provide a custom {@link Form}.
*
* @param id
* The id to be used to construct the component
* @return a new form
*/
protected Form newForm(String id)
{
return new Form(id)
{
private static final long serialVersionUID = 1L;
protected void delegateSubmit(IFormSubmittingComponent submittingComponent)
{
/*
* In the standard submit flow, the onSubmit of the Form is called after the
* onSubmit of the submittingComponent. For the Wizard, this must be reversed.
*/
Form formToProcess = this;
if (submittingComponent != null)
{
// use the form which the submittingComponent has submitted for further
// processing
formToProcess = submittingComponent.getForm();
}
// call onSubmit on the submitted form
formToProcess.onSubmit();
// call onSubmit on nested forms
formToProcess.visitChildren(Form.class, new IVisitor()
{
public Object component(Component component)
{
Form form = (Form)component;
if (form.isEnabled() && form.isEnableAllowed() &&
form.isVisibleInHierarchy())
{
form.onSubmit();
return IVisitor.CONTINUE_TRAVERSAL;
}
return IVisitor.CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER;
}
});
// reverse standard flow: execute the submittingComponent#onSubmit
// after the Form#onSubmit()
submittingComponent.onSubmit();
}
};
}
In order for this to work, I need Form.onSubmit() to be public. If this is not adjusted in the Wizard, than the Wizard is not working properly. See my attached patch 'wizard-patch-revised-1.3.x.txt' with the necessary changes (haven't run it in my application yet).
> 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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Dave Schoorl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dave Schoorl updated WICKET-2150:
---------------------------------
Attachment: wizard-patch-1.3.x.txt
For 1.3.x branch a patch is attached.
The patch adds an afterFormOnSubmit() to the IFormSubmittingComponent which is executed at the end of Form#delegateSubmit(IFormSubmittingComponent submittingComponent).
The processing of the WizardButton has been moved from onSubmit() to afterFormOnSubmit().
> 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
>
>
> 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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Dave Schoorl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dave Schoorl updated WICKET-2150:
---------------------------------
Attachment: wizard-patch-revised-1.4.x.txt
Johan, please find attached my patch 'wizard-patch-revised-1.4.x.txt' for 1.4. Form#onSubmit is public there and the Wizard#newForm method is adapted. The form-implementation returned provides a custom onSubmit flow. Making Form#onSubmit public causes all overridden implementations of this method in test cases to be changed to public as well.
Thanks for your cooperative thinking. Reality is always more complex. The app I am building is highly pluggable and third parties must be able to supply their own plug-ins. When a page is created, plug-ins can contribute to the page, this also goes for the views in my Wizards. So basically, I have no control over all forms that will be placed on the wizard's view. Moreover, every customer that uses the system can configure the plug-ins that he wants to be activated in his environment. The app itself is capable of running all these different customer environments.
But for this moment I will use a custom 1.3-SNAPSHOT of wicket that i have build locally where the submitted patch is applied. This is a temporary situation, until I have migrated to Wicket 1.4.
Many thanks again.
> 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, wizard-patch-revised-1.4.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.
[jira] Updated: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeremy Thomerson updated WICKET-2150:
-------------------------------------
Fix Version/s: (was: 1.4-RC3)
(was: 1.3.6)
1.4-RC4
> 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.4-RC4
>
> Attachments: wizard-onsubmit.zip, wizard-patch-1.3.x.txt, wizard-patch-1.4.x.txt, wizard-patch-revised-1.3.x.txt, wizard-patch-revised-1.4.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.
[jira] Commented: (WICKET-2150) Wizard executes onSubmit() of wrong
nested form
Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688950#action_12688950 ]
Jeremy Thomerson commented on WICKET-2150:
------------------------------------------
Johan,
I haven't looked at this particular report in depth, but are you sure that it's not similar or related to this one:
https://issues.apache.org/jira/browse/WICKET-2063
> 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
>
>
> 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.