[
https://issues.apache.org/jira/browse/WICKET-4121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13125678#comment-13125678
]
Sven Meier commented on WICKET-4121:
------------------------------------
Background: In 1.5 handling of a step's IFormValidator has been migrated to the
new onInitialize() feature. Now isActiveStep() is called which needs a
reference to its owning wizard model.
The steps of your "secondLevelModel" are never initalized (i.e.
init(IWizardModel) is never called), because this functionality is located in
Wizard#init(IWizardModel) but the wizard never gets in contact to your nested
model.
I'd prefer to move the relevant code from Wizard to WizardModel#reset(). IMHO
this is a much better place for it.
It would be great if you'd be able to test the attached patch.
> WizardStep$FormValidatorWrapper.isActiveStep(WizardStep.java) causes
> NullPointerException
> -----------------------------------------------------------------------------------------
>
> Key: WICKET-4121
> URL: https://issues.apache.org/jira/browse/WICKET-4121
> Project: Wicket
> Issue Type: Bug
> Components: wicket-extensions
> Affects Versions: 1.5.1
> Reporter: Dirk Forchel
> Attachments: wizardtest.zip
>
>
> Using the Wizard with a nested WizardModel (see RecursiveWizardModel
> implementation at the attached quickstart application) causes a
> NullPointerException. I was able to run the same test application with wicket
> 1.4.18 without any problems.
> Caused by: java.lang.NullPointerException
> at
> org.apache.wicket.extensions.wizard.WizardStep$FormValidatorWrapper.isActiveStep(WizardStep.java:145)
> at
> org.apache.wicket.extensions.wizard.WizardStep$FormValidatorWrapper.getDependentFormComponents(WizardStep.java:109)
> at
> org.apache.wicket.markup.html.form.validation.FormValidatorAdapter.getDependentFormComponents(FormValidatorAdapter.java:47)
> at
> org.apache.wicket.markup.html.form.Form.validateFormValidator(Form.java:1782)
> at
> org.apache.wicket.markup.html.form.Form.validateFormValidators(Form.java:1828)
> at org.apache.wicket.markup.html.form.Form.validate(Form.java:1706)
> at org.apache.wicket.markup.html.form.Form.process(Form.java:773)
> at
> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:728)
> at
> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:670)
--
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