How can I capture the event filtering a datatable in primefaces How can I capture the event filtering a datatable in primefaces ajax ajax

How can I capture the event filtering a datatable in primefaces


Primefaces p:dataTable has AJAX event filter which you can define on p:dataTable:

<p:dataTable>  <p:ajax event="filter" listener="#{myBean.filterListener}"/></p:dataTable>

Now in your backing bean define method filterListener:

public void filterListener(FilterEvent filterEvent) {  // your code here...}

Now, your filterListener function will be called on every filter event.