Volodymyr Siedlecki created MYFACES-4764:
--------------------------------------------

             Summary: @child(N) fails in 4.1.x snapshot
                 Key: MYFACES-4764
                 URL: https://issues.apache.org/jira/browse/MYFACES-4764
             Project: MyFaces Core
          Issue Type: Bug
            Reporter: Volodymyr Siedlecki


The @child(N) search keyword resolver in ChildSearchKeywordResolver contains a 
bug introduced in MyFaces 4.1 that causes @child(N) to resolve to the wrong 
component when any UntargetableComponent children precede the target in the 
component tree.



In ChildSearchKeywordResolver.resolve(), the loop correctly counts only 
non-UntargetableComponent children to find the logical @child(N). However, when 
invoking the callback it uses children.get(childNumber) — the raw list index — 
instead of children.get(i) — the actual position of the matching component.


Working:
<label for="form1">Body Child(1)</label>

Failing:
<label for="j_id_a">Body Child(1)</label>

Change where this problem was introduced: 
https://github.com/apache/myfaces/commit/01566fc67f7d672892ac7324b66e8fb7a927c8fb#diff-d1db49a29a4071345c052b93fc70743eb79f29b27bb84221089a5e62dd1d369fL18-L69



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

Reply via email to