javaee / mojarra

PLEASE NOTE: This project has moved to Eclipse Foundation and will be archived under the JavaEE GitHub Organization. After Feb. 1, 2021, the new location will be github.com/javaee/mojarra. Mojarra - Oracle's implementation of the JavaServer Faces specification
https://github.com/eclipse-ee4j/mojarra
Other
164 stars 58 forks source link

UIData/UIRepeat do not honor VisitHint.SKIP_ITERATION #1903

Closed javaserverfaces closed 13 years ago

javaserverfaces commented 13 years ago

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]

javaserverfaces commented 13 years ago

Reported by aschwart

javaserverfaces commented 13 years ago

rogerk said: triage

javaserverfaces commented 13 years ago

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.

javaserverfaces commented 13 years ago

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.

javaserverfaces commented 13 years ago

rogerk said: Thanks Andy -

I'll take a look at this.

-roger

javaserverfaces commented 13 years ago

rogerk said: Changes - first iteration.

javaserverfaces commented 13 years ago

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.

javaserverfaces commented 13 years ago

rogerk said: Revised change bundle taking into account Andy's comments.

javaserverfaces commented 13 years ago

rogerk said: Fixed and will be included in 2.1.1. Reviewed by Andy Schwartz.

javaserverfaces commented 13 years ago

rogerk said: Set target version 2.1.1

javaserverfaces commented 13 years ago

rogerk said: Checked into 2.1.1 branch.

javaserverfaces commented 12 years ago

@manfredriem said: Closing resolved issue out

javaserverfaces commented 13 years ago

File: changebundle-1899.txt Attached By: rogerk

javaserverfaces commented 13 years ago

File: changebundle-1899.txt Attached By: rogerk

javaserverfaces commented 13 years ago

Was assigned to rogerk

javaserverfaces commented 7 years ago

This issue was imported from java.net JIRA JAVASERVERFACES-1899

javaserverfaces commented 13 years ago

Marked as fixed on Wednesday, February 9th 2011, 2:42:35 am