title: Primefaces datatable filter specific column in header
body: <p>In Primefaces datatable, it can filter a specific column by the following code: </p>
  
  <pre><code>&lt;p:column filterBy="#{car.id}" headerText="Id" filterMatchMode="contains"&gt;
      &lt;h:outputText value="#{car.id}" /&gt;
  &lt;/p:column&gt;
  </code></pre>
  
  <p>The code above will generate a filter on the header of the column. What I want is create a filter on the header of datatable, not column. From the <a href="https://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml" rel="nofollow noreferrer">ShowCase</a>, there is a code:</p>
  
  <pre><code>&lt;f:facet name="header"&gt;
      &lt;p:outputPanel&gt;
          &lt;h:outputText value="Search all fields:" /&gt;
          &lt;p:inputText id="globalFilter" onkeyup="PF('carsTable').filter()"/&gt;
      &lt;/p:outputPanel&gt;
  &lt;/f:facet&gt;
  </code></pre>
  
  <p>This will put a filter in header of datatable, but it will filter the all fields of the datatable, which is what I don't want, I want it to filter specific column only, is it possible?</p>