title: Filter Datatable from Backing Bean jsf-primefaces
body: <p>I have a primefaces datatable and i have a column with filter.i would like to apply filter on the column from the backing bean.</p>
  <p>I followed this <a href="https://stackoverflow.com/questions/15485452/how-to-get-the-values-entered-in-the-field-filtered-datatable-of-primefaces">example</a> and i am able to get the input given filter text box into my bean.</p>
  <p>but when i use setFilter ,the values are being set in the HashMap but filter is not being applied on the datatable.</p>
  <p>Example column</p>
  <pre><code>&lt;p:column filterBy=&quot;#{var.value}&quot; headerText=&quot;Example&quot; footerText=&quot;contains&quot; filterMatchMode=&quot;contains&quot; /&gt;
  </code></pre>
  <p>Bean is session scoped and the following code is in a function which gets called on a button click.</p>
  <pre><code>Map&lt;String,String&gt; theFilterValues = new HashMap&lt;String,String&gt;();
      theFilterValues.put(&quot;filterColumn&quot;,&quot;someValue&quot;);
      myDataTable.setFilters(theFilterValues);
  </code></pre>
  <p>this sets the values ,but there is no change on datatable.</p>
  <p>i tried <a href="https://stackoverflow.com/questions/15450274/setting-default-value-in-primefaces-datatable-filter">this</a> but it did not help.</p>
  <p><strong>All i need is to set a filter on the datatable column upon a button click.</strong>
  Thanks in advance</p>