Jiri Slovak created MYFACES-4074: ------------------------------------ Summary: 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
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)