Search code examples
primefacesprimefaces-datatable

PrimeFaces p:column filter facet not displayed


I have this PrimeFaces (4.0) table:

<p:dataTable id="datalist" widgetVar="datalist"
             value="#{hoursController.lazy}"
             lazy="true"
             filteredValue="#{hoursController.filteredItems}"
             var="item"
             selectionMode="single" selection="#{hoursController.selected}"
             rowKey="#{item.id}"
             paginator="true" paginatorPosition="bottom"
             rows="10"
             sortBy="workDate" sortOrder="descending">

With this column containing a filter facet (trying to replicate the brands filter in the PrimeFaces DataTable filter showcase):

<p:column headerText="#{msg.table_header_hours_emplId}"
          sortBy="#{item.emplId}"
          filterBy="#{item.emplId}" filterMatchMode="exact">
  <f:facet name="filter">
    <p:selectOneMenu onchange="PF('datalist').filter()">
      <f:selectItem itemLabel="" itemValue="#{null}" noSelectionOption="true" />
      <f:selectItems value="#{employeesController.items}" />
    </p:selectOneMenu>
  </f:facet>
  <h:outputText value="#{item.emplId}" />
</p:column>

The p:selectOneMenu is not displayed, but instead I just get a plain text input filter.

I removed all kinds of attributes from the table (lazy loading for example) to see if they were causing the filter not to be rendered, but all with the same result.

I'm also sure the p:selectOneMenu is correct; when I place it outside of the table it select menu is displaying the correct content.

I've also checked the specification on extra information on the filter facet, but could find any additional information.

Can anybody tell what I'm doing wrong?


Solution

  • Apparently the filter facet was added in PrimeFaces 5 (so it does not work in 4). This was not mentioned in the documentation and showcase.