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

Pedro Santos edited comment on WICKET-3899 at 11/6/24 3:31 PM:
---------------------------------------------------------------

> hrm. we need to write up a bunch of tests for IFormVisitorParticipant. a lot 
> of things seem to be rather broken.

Form#validateNestedForms
Form#callOnErrorForm#delegateSubmit
 
are the methods traversing the form hierarchy without the #processChildren test
 
> looking at ValidationVisitor, for example, there is a check there and a call 
> to not go deeper if

> processChildren() returns false. however, this makes little sense since the 
> visitor is used at a

> postorder traversal and so by the time the children are visited before the 
> component - which

> makes dontgodeeper() a noop.

Indeed, dontgodeeper() both has no effect there as it duplicates the correct 
#processChildren test done inside the Form#visitFormComponentsPostOrder. The 
same problem happens in Form#callOnError, which is calling #dontGoDeeper inside 
a postorder traversal
 
> further, there is a problem with formvalidators. currently form validators 
> only check if the

> dependent form components are visible in hierarchy. but, they also need to 
> check if any

> parent of the component is a participant, and if they are test if children 
> should be processed.

> this should be done for the rootform->component hierarchy in that order.

> lots of work for this one... :/

I would add that the need to check if dependent components are enabled in the 
hierarchy as well, sounds a lot of work indeed


was (Author: pedrosans):
@Igor, we have no reason to be worried about ValidationVisitor being broke 
because of the parodox of it being testing a variable relevant for preorder 
visits while performing a post one. What happens is that 
Visits#visitPostOrderHelper visit all components in the tree using preorder to 
test their "visitChildren" control flag. 

void visitPostOrderHelper(){
   if (filter.visitChildren(container)){
      visitPostOrderHelper(); <-- goes deeper only after test if visit children 
is allowed, the preorder logic.
   }
   visitor.component(component, visit); <-- the visit code is placed only after 
the recursion one, characterizing the postorder, even after the pre one being 
used before to test how deep to go in the tree
}

> IFormVisitorParticipant don't get tested when validation method is visiting 
> inner forms
> ---------------------------------------------------------------------------------------
>
>                 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
>         Attachments: WICKET-3899-fix-test.patch, WICKET-3899.patch
>
>
> The inconsistencies is at Form#validate method. It invokes 
> validateNestedForms and validateComponents, but only the second one uses a 
> visitor filter testing for IFormVisitorParticipant#processChildren value.
> More about: http://markmail.org/message/q2qfuyg3gcrurxxp



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

Reply via email to