Primefaces datatable sorting after filtering
<p>I have a p:dataTable which stores the results of a processed form, and I perform the following actions:</p>

<ol>
<li>Fill form values.</li>
<li>Submit.</li>
<li>Data table is populated -- filter on any column.</li>
<li>Change form values.</li>
<li>Submit.</li>
<li>Data table is populated with new results.</li>
<li>Sort on any column -- filtered results from #3 are displayed.</li>
</ol>

<p>I have an arraylist for the filtered values, but I am not doing anything to it in the bean. On submit, I am calling an actionListener which casts the dataTable to primefaces.components.datatable.DataTable and then calling a resetValue() on it (see code snippet below), before I process the form.</p>

<p>I've tried multiple ways of resetting, clearing and updating the dataTable, but I'm not able to get around the above issue. Just for reference, this is my p:dataTable tag:</p>

<pre><code>&lt;p:dataTable
            id="resultsDataTable"
            rendered="#{entityReportBean.isResultsPopulated}"
            var="change"
            value="#{entityReportBean.entityChangeDto}"
            styleClass="resultsPanel"
            rows="100"
            paginator="true"
            paginatorPosition="top"
            paginatorTemplate="#{PreviousPageLink}  Previous  {CurrentPageReport}  Next  {NextPageLink}"
            filterEvent="enter"
            filteredValue="#{entityReportBean.filteredResults}" &gt;
</code></pre>

<p>and this is the actionListener:</p>

<pre><code>    public void onSubmit() {
            FacesContext context = FacesContext.getCurrentInstance();
            DataTable resultsTable = (DataTable) context.getViewRoot().findComponent("results:resultsDataTable");
            resultsTable.resetValue();
                ...
</code></pre>

<p>I am fairly new to JSF/Primefaces so there might be some basic operation I'm unaware of. Any suggestions?</p>