Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4074

MyFaces + Primefaces: Dynamic ui:include + UIData (with rowStatePreserved) rendering problem

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 2.2.11
    • Fix Version/s: None
    • Component/s: JSR-314
    • Labels:
      None

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              lu4242 Leonardo Uribe
              Reporter:
              slovi Jiri Slovak
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: