0
votes

I have a Primefaces datatable that is inside an accordionPanel
Now when I added a filter to one column, datatable is no more correctly displayed correclty when filter applied.
When debugging, I can see that the org.primefaces.component.datatable.DataTableRenderer is called and it seems to work correctly (adding tr elements), but when I inspect the html in my browser, there are only inputs and plain text.
Here is the rendering of the datatable before filtering:

Datatable before hitting the filter

And here is the rendering of the datatable after selecting a filter value:

Rendering after hitting the filter

And here is a little bit of code that can reproduce the issue:

<p:accordionPanel multiple="true" id="someId" activeIndex="1">
   <p:tab title="title" id="tabId">
      <p:dataTable var="item" widgetVar="itemTbl" id="itemTbl" value="#{managedBean.items}" 
            filteredValue="#{managedBean.filtered}" style="margin-top:20px;">

          <p:column style="width: 129px !important">
                <f:facet name="header">
                    <h:outputLabel value="Column1"></h:outputLabel>
                </f:facet>
                <h:outputText value="#{item.id}"></h:outputText>
            </p:column>
          <p:column style="width: 101px !important" filterBy="name"
                filterOptions="#{managedBean.itemOptions}"
                        filterMatchMode="exact">
                <f:facet name="header">
                    <h:outputLabel value="Column2"></h:outputLabel>
                </f:facet>
                <h:outputText value="#{item.name}"></h:outputText>
            </p:column>
        </p:dataTable>
  </p:tab>
</p:accordionPanel>

I am using JSF 2.2 (Mojarra) and Primefaces 4.

Any help would be more than appreciated

1

1 Answers

2
votes

I finally found out the cause behind this weird behaviour: My datatable was placed inside a p:outputPanel with autoupdate set to true. I hope this will be of some help