[ https://issues.apache.org/jira/browse/MYFACES-3033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992310#comment-12992310 ]
Andy Schwartz commented on MYFACES-3033: ---------------------------------------- Trinidad also suppress table iteration based on the phase id. From UIXComponent: // determine whether this visit should be iterating. If it shouldn't, don't // even call the protected hook. We currently don't iterate during the // restore view phase when we are visiting all of the components. boolean noIterate = (visitContext.getIdsToVisit() == VisitContext.ALL_IDS) && (context.getCurrentPhaseId() == PhaseId.RESTORE_VIEW); doneVisiting = (noIterate) ? uixParentComponent._visitAllChildren(visitContext, callback) : uixParentComponent.visitChildren(visitContext, callback); However, as of the following MyFaces fix: MYFACES-3036 Support SKIP_ITERATION FacesContext property https://issues.apache.org/jira/browse/MYFACES-3036 Both MyFaces and Mojarra support the "javax.faces.visit.SKIP_ITERATION" FacesContext property in their 2.0.x code bases. This means that iterating components can now decide whether or not to iterate based on the presence of this property. I have logged the following issue against Trinidad on this topic: TRINIDAD-2030 Honor SKIP_ITERATION FacesContext property https://issues.apache.org/jira/browse/TRINIDAD-2030 It would be good if RichFaces would also take advantage of this. This should avoid the problem reported here - ie. if iterating components check for the SKIP_ITERATION property rather checking for restore view phase, the DebugPhaseListener's tree visit should be able to safely evaluate EL. > Improve DebugPhaseListener for UIData and SKIP_ITERATION > -------------------------------------------------------- > > Key: MYFACES-3033 > URL: https://issues.apache.org/jira/browse/MYFACES-3033 > Project: MyFaces Core > Issue Type: Improvement > Components: General > Affects Versions: 2.1.0 > Reporter: Martin Kočí > > <h:dataTable var="row" > > <h:column> > <h:outputText rendered="#{bean.isRendered(row)}" > There is new VisitHint.SKIP_ITERATION in JSF 2.1. If that hint is used UIData > iterate over children in "flat" manner and therefore no row is available - > bean.isRendered(row) obtains null as parameter and NPE can happen. One > problem in this situation is a component tree walk before RESTORE_VIEW from > DebugPhaseListener: > java.lang.NullPointerException > foo.bazz.bean.isRendered > ... > at > org.apache.myfaces.view.facelets.el.TagValueExpression.getValue(TagValueExpression.java:85) > at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:260) > at javax.faces.component.UIComponentBase.isRendered > ... > at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:991) > at > org.apache.myfaces.view.facelets.tag.ui.DebugPhaseListener._doTreeVisit(DebugPhaseListener.java:310) > at > org.apache.myfaces.view.facelets.tag.ui.DebugPhaseListener.afterPhase(DebugPhaseListener.java:286) -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira