David van Enckevort created WICKET-4929:
-------------------------------------------
Summary: AjaxFormValidatingBehavior.addToAllFormComponents only
adds the behaviour to direct descendents of the form
Key: WICKET-4929
URL: https://issues.apache.org/jira/browse/WICKET-4929
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 6.3.0, 6.2.0
Environment: Tested on Mac OS X 10.8, Debian 6 with JDK 1.6, but the
issue is not platform dependent.
Reporter: David van Enckevort
Attachments: AjaxFormValidatingBehavior.tgz
== Description ==
The AjaxFormValidatingBehavior.addToAllFormComponents call only adds the
behaviour to the direct descendents of the Form component. FormComponent
components that are part of a ListView do not get the behaviour added.
== Expected behaviour ==
This method should go through the entire hierarchy below the form component and
add the behaviour to all components.
== Resolution ==
I reproduced the issue in the attached test application and traced the issue to
the following line in AjaxFormValidatingBehavior.java (as line specified as
diff)
diff AjaxFormValidatingBehavior.java{,.new}
151d150
< visit.dontGoDeeper();
I would propose to remove the visit.dontGoDeeper() call.
== Impact ==
* I do realise that it will have some performance penalty, but I expect this to
be negligible. For forms with a deep hierarchy you should add the behaviour to
the specific fields where it is expected.
* Changing the behaviour may have unexpected side effects for people who have a
subform and depend on the current behaviour of not recursing. However I believe
that code would be depending on incorrect behaviour and should be corrected by
explicitly adding the behaviour only to the intended fields.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira