using addChildForm for validation reporting can leave FormBackedWizardPage form guard in an improper state
----------------------------------------------------------------------------------------------------------
Key: RCP-260
URL: http://opensource.atlassian.com/projects/spring/browse/RCP-260
Project: Spring Framework Rich Client Project
Type: Bug
Components: Binding System
Versions: PR1
Reporter: Frank Bowers
Assigned to: Oliver Hutchison
I'm using the version of AbstractForm which has the fix for RCP-254.
1. Construct a form with an embedded child form.
2. Use addChildForm to properly setup validation results reporting.
3. Use the form as the backing form for a FormBackedWizardPage
4. Place the form in such a state that there are validation errors only in the child form.
5. Invoke Next in the containing wizard to go to the FormBacked page
4. Note that the Next button is enabled although the page contains errors if you haven't made the fix below to AbstractForm.hasErrors().
When FormBackedWizardPage.onAboutToShow is invoked a call to hasErrors is made. Because the parent form doesn't have any errors the page is enabled although the child form has errors.
The fix is to make AbstractForm.hasErrors() aware of the child forms:
public boolean hasErrors() {
if (formModel.getValidationResults().getHasErrors())return true;
else {
for (Iterator iter = childForms.values().iterator(); iter.hasNext(); ) {
Form childForm = (Form) iter.next();
if (childForm.hasErrors()) return true;
}
}
return false;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|