Closed javaserverfaces closed 13 years ago
Reported by aschwart
rogerk said: triage
aschwart said: Updated the Summary to reflect the fact that the same problem exists in UIRepeat.
Note that in 2.0.4, both UIData and UIRepeat correctly honor the skip iteration hint. (Which, at that point, was a FacesContext property rather than a formal VisitHint enum value.) For example, the 2.0.4 version of UIData checks whether iteration is necessary as follows:
private boolean requiresRowIteration(FacesContext ctx)
{ // PENDING: Visit Hints as FacesContext Attribute until add new hints to spec. // See: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=545 Object skipHint = ctx.getAttributes().get("javax.faces.visit.SKIP_ITERATION"); return !Boolean.TRUE.equals(skipHint); }
In 2.1, this should instead use the new VisitHint, eg:
private boolean requiresRowIteration(VisitContext visitContext)
{ return !visitContext.getHints().contains(VisitHint.SKIP_ITERATION); }
However, at the moment we have:
private boolean requiresRowIteration(FacesContext ctx)
{ return (!PhaseId.RESTORE_VIEW.equals(ctx.getCurrentPhaseId())); }
As a result, the new 2.1 VisitHint.SKIP_ITERATION API does not work correctly: both UIData and UIRepeat still iterate during visits when this hint is set.
aschwart said: Adjusting priority from Minor->Major since without this one of the key new features of JSF 2.1 (SKIP_ITERATION visit hint) is broken.
rogerk said: Thanks Andy -
I'll take a look at this.
-roger
rogerk said: Changes - first iteration.
aschwart said: With the patch we now perform two tests:
I believe that the FacesContext test is no longer necessary. That is, we no longer need to do this:
private boolean requiresRowIteration(FacesContext ctx)
{ return (!PhaseId.RESTORE_VIEW.equals(ctx.getCurrentPhaseId())); }
Now that we've got the VisitHint.SKIP_ITERATION API.
rogerk said: Revised change bundle taking into account Andy's comments.
rogerk said: Fixed and will be included in 2.1.1. Reviewed by Andy Schwartz.
rogerk said: Set target version 2.1.1
rogerk said: Checked into 2.1.1 branch.
@manfredriem said: Closing resolved issue out
File: changebundle-1899.txt Attached By: rogerk
File: changebundle-1899.txt Attached By: rogerk
Was assigned to rogerk
This issue was imported from java.net JIRA JAVASERVERFACES-1899
Marked as fixed on Wednesday, February 9th 2011, 2:42:35 am
JSF 2.1 introduced the VisitHint.SKIP_ITERATION API for performing tree visits that do not result in iteration over each row in iterating/stamping components (such as UIData). UIData's visitTree() implementation does not yet honor this VisitHint.
Affected Versions
[2.1.0]