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

ASF GitHub Bot commented on WICKET-3899:
----------------------------------------

pedrosans commented on code in PR #1033:
URL: https://github.com/apache/wicket/pull/1033#discussion_r2109800319


##########
wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java:
##########
@@ -2059,13 +2020,13 @@ protected final void validateFormValidator(final 
IFormValidator validator)
                                }
                                // check if the dependent component is visible 
and is attached to
                                // the page
-                               else if 
(!isFormComponentVisibleInPage(dependent))
+                               else if (!dependent.isVisibleInHierarchy() || 
!dependent.isEnabledInHierarchy() || !dependent.isFormParticipant())

Review Comment:
   > what do you mean by "dirty" data?
   
   Any value returned by dependent formComponent#getInput() or 
#getConvertedInput() will have not been validated during the form processing 
before the formvalidator check. wicket-core for instance has formvalidators 
accessing dependent form component values without checking if they are valid or 
not, because it should be safe to assume they are valid inside 
IFormValidator#validate execution.





> IFormVisitorParticipant don't get tested when validating form validators 
> dependent components
> ---------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3899
>                 URL: https://issues.apache.org/jira/browse/WICKET-3899
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.17, 1.5-RC5.1
>            Reporter: Pedro Santos
>            Assignee: Pedro Santos
>            Priority: Major
>             Fix For: 10.3.0
>
>         Attachments: WICKET-3899-fix-test.patch, WICKET-3899.patch, 
> image-2025-01-29-09-26-47-144.png
>
>
> Currently Form#validateFormValidator only check if dependent components are 
> visible in the page, which causes it to validate forms depending on 
> components that didn't participate in the form processing like:
>  * disable form components
>  * components under an IFormVisitorParticipant parent that returned false in 
> the #processChildren test
>  * components inside a form that was not processed due the 
> Form#wantSubmitOnParentFormSubmit test inside a parent form



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to