Repository navigation
Conversation
A component inside a c:if inside a c:forEach rendered the item of another row after a postback which changed the outcome of the c:if (#6194). The build which re-applies the facelet before Render Response found an existing component by a mark id from a per-tag counter of applications. Once a c:if skipped a row, the n-th application found the component the restoring build had created for the n-th row. A found component keeps its attributes, so it kept the IndexedValueExpression of that row. The same held for a nested c:forEach of which the enclosing row was skipped. It also held for the context prefix of an include, template, insert, composite component or tag file inside a skipped row: its components were recreated and lost their state. IterationIds now counts these ids and prefixes per row: - an outermost iteration counts from where the counter stood plus the row, and moves the counter past all its rows when it stops, so ids stay byte-identical when no row is skipped - a nested iteration counts by its own row under a "_r<row>" path of the enclosing rows - a tag applied twice for one row gets a "-<n>" repeat suffix The bug exists since Mojarra 2.0.0. MyFaces does not have it, as its ForEachHandler opens a unique id section per row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6194
The build which re-applies the facelet before Render Response matched components by a per-tag counter of applications. A
c:ifwhich skipped a row inside ac:forEachtherefore made a row find the component of another row, which kept its old row'sIndexedValueExpression. The same held for a nestedc:forEachwhose enclosing row was skipped, and for the context prefix of an include, template, insert, composite component or tag file inside a skipped row.IterationIdsnow counts unique ids and context prefixes per row:_r<row>path of the enclosing rows-<n>repeat suffixTests:
IterationIdsTestandDefaultFaceletContextIterationIdTestpin the counting and the exact id and prefix strings.Issue6194ITcovers a flat, a nested and an includedc:forEach. All three fail without this fix.🤖 Assisted by Claude Opus 5.5