How can I get new filtered values in a datatable primefaces
<p>I  could not find a way to make update of a component after getting filtered values of datatable. I try different ways :</p>

<ul>
<li><p>Test 1 : I try to use the action of the <code>Filter</code> event, but this event is done before the change of values, so I can't make my calculation with the new values</p></li>
<li><p>Test 2 : I try to use the Listener of the <code>Filter</code> event, but I couldn't find the new values in the <code>AjaxBehaviorEvent</code></p></li>
<li><p>Test 3 : I try to call my function in the setter of the filtered values, the calculation is done but not updated... So I try to use <code>RequestContext</code> of primefaces but it doesn't work either.</p></li>
</ul>

<p>Tell me if you have an idea to unlock one way, or to propose new solutions =)</p>

<p>Thanks for your help!</p>

<p>Console return, to show the order of the event.</p>

<pre><code>&gt;test 1
&gt;test 2
&gt;update other
&gt;update filtered values
&gt;test 3
</code></pre>

<p>HTML code :</p>

<pre><code>&lt;h:form id="form1"&gt;
    &lt;p:dataTable var="_remontee" value="#{ConsultationSaisieBean.m_valuesInDataGrid}" 
    filteredValue="#{ConsultationSaisieBean.m_filteredValues}"  &gt;

        &lt;p:ajax event="filter"  listener="#{ConsultationSaisieBean.OnFilter}" 
        action="#{ConsultationSaisieBean.FilterAction}" update=":form2"/&gt;

        &lt;p:columns value="#{ConsultationSaisieBean.m_columns}" var="column" 
        filterBy="#{_remontee[column.property]}" filterMatchMode="contains"&gt;
            &lt;f:facet name="header"&gt;
                &lt;h:outputText value="#{column.header}" /&gt;
            &lt;/f:facet&gt;
            &lt;h:outputText value="#{_remontee[column.property]}" /&gt;
        &lt;/p:columns&gt;
   &lt;/p:dataTable&gt;
&lt;/h:form&gt;

&lt;h:form id="form2"&gt;
   &lt;p:outputLabel id="other" value="#{ConsultationSaisieBean.m_serviceResult}" /&gt;
&lt;/h:form&gt;
</code></pre>

<p>Java class :</p>

<pre><code>/**
 * function of the filter event's action
 */
public void FilterAction()
{
    // TEST 1
    System.out.println("test 1");
    setM_consummableResult(Resultof(m_filteredValues))
}

/**
 * function of event's listener 
 */
public Map&lt;String, Object&gt;  OnFilter(AjaxBehaviorEvent p_event)
{
    // TEST 2
    System.out.println("test 2");
    setM_consummableResult(Resultof(m_filteredValues))

    // return values wanted by the event
    DataTable table = (DataTable) p_event.getSource();
    Map&lt;String, Object&gt; filters = table.getFilters();
    return filters;
}

/**
 * Setter of the filtered values
 */
public void setM_filteredValues(List&lt;Map&lt;String, String&gt;&gt; p_filteredValues)
{
    // UPDATE FILTERED VALUES
    System.out.println("update filtered values");

    super.setM_filteredValues(p_filteredValues);

    // TEST 3
    System.out.println("test 3");
    setM_consummableResult(Resultof(m_filteredValues))

    //Test to force update 
    RequestContext context = RequestContext.getCurrentInstance();
    context.addCallbackParam("saved", true); 
    context.update("form2:other");
}

/**
 * function to count the new result
 */
public void Resultof(List&lt;Map&lt;String, String&gt;&gt; p_filteredValues)
{
    /* calcul the new values */
}

/**
 * getter for update the other component
 */
public Double getM_consummableResult()
{
    return m_consummableResult;
    // UPDATE
    System.out.println("update other");
}

public List&lt;Map&lt;String, String&gt;&gt; getM_filteredValues()
{
    return m_filteredValues;
}

private void setM_consummableResult(Double m_consummableResult)
{
    this.m_consummableResult = m_consummableResult;
}
</code></pre>