[ https://issues.apache.org/jira/browse/MYFACES-4074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15624338#comment-15624338 ]
Leonardo Uribe commented on MYFACES-4074: ----------------------------------------- The javadoc of javax.faces.view.facelets.ComponentHandler defines the behavior of ComponentTagHandlerDelegate. There is a part that mentions call markInitialState(). There is a web config param in MyFaces called org.apache.myfaces.MARK_INITIAL_STATE_WHEN_APPLY_BUILD_VIEW that allows you to call markInitialState() only after the view is built, but I don't know if that could help in your case. MyFaces PSS algorithm aim to apply PSS inclusive in sections where ui:include src=EL expr is used. Mojarra does not have those optimisations. I ignore what's inside primefaces, but I'm aware there is a copy of Mojarra UIData deep inside its sources, so the fix should be done there. > MyFaces + Primefaces: Dynamic ui:include + UIData (with rowStatePreserved) > rendering problem > -------------------------------------------------------------------------------------------- > > Key: MYFACES-4074 > URL: https://issues.apache.org/jira/browse/MYFACES-4074 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-314 > Affects Versions: 2.2.11 > Reporter: Jiri Slovak > Assignee: Leonardo Uribe > > There is a situation where UIData with rowStatePreserved is not rendered. > NullPointer exception is thrown in this case. > The example of such situation is: > we have index.xhtml with ui:include with src attribute as expression > <h:form> > <h:panelGrid columns="1" bodyrows="3"> > <p:commandLink > action="#{mainFrameBean.setMenu('iframe1.xhtml')}" process="@this" > update=":mainframe">Frame 1</p:commandLink> > <p:commandLink > action="#{mainFrameBean.setMenu('iframe2.xhtml')}" process="@this" > update=":mainframe">Frame 2</p:commandLink> > <p:commandLink > action="#{mainFrameBean.setMenu('iframe3.xhtml')}" process="@this" > update=":mainframe">Frame 3</p:commandLink> > </h:panelGrid> > </h:form> > <p:outputPanel id="mainframe"> > <ui:include src="/frames/#{mainFrameBean.menuValue}" /> > </p:outputPanel> > we have datagrid coded in iframe2.xhtml > <p:dataGrid var="car" value="#{dataGridView.cars}" columns="3" layout="grid" > rows="12" paginator="true" id="cars" rowStatePreserved="true" > paginatorTemplate="{CurrentPageReport} {FirstPageLink} > {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} > {RowsPerPageDropdown}" > rowsPerPageTemplate="6,12,16"> > <f:facet name="header"> > Cars for Sale > </f:facet> > <p:panel header="#{car.id}" style="text-align:center"> > <h:outputText value="#{car.year}" /> > </p:panel> > </p:dataGrid> > Then if you click "Frame 2" commandlink you get nullpointer returned in the > partial response XML. > The problem is UIData incorrectly handles initial descendant state during the > render response phase. > I`ve prepared testapp code in github as an exapmle: > https://github.com/slovi/myfaces_primefaces_uidata_issue > (link 4 does not work correctly with myfaces, but works well with Mojarra). > It seems the problem is that MyFaces sets initial state during the render > response phase (in case of partial request), whilst Mojarra sets > markInitialState during the build phase. > Jiri -- This message was sent by Atlassian JIRA (v6.3.4#6332)