title: Primefaces Datatable filter values are lost after the datatable is refreshed
body: <p>I am using JSF 2.0 and Primefaces 3.2. I have a main form with a datatable and a button on each row that brings up a dialog with another data table. The dialog has its own form. When the datatable row is selected in the dialog, i process the selection and then refresh the datatable in the main form. After the refresh all my filters on the main datatable are lost. Is there a way to remember the filter values? </p>
  
  <p><strong>My JSF page</strong></p>
  
  <pre><code>&lt;h:panelGroup id="mainTable"&gt;
  &lt;h:form id="mainForm" prependId="false"&gt;                
  &lt;p:dataTable id="cl_grid1" var="item"    widgetVar="mainGrid"
                  value="# {controller.items}"&gt;
  
  
  &lt;p:column headerText="Colum1" filterMatchMode="contains" filterBy="#{item.myObj.code}" sortBy="#{item.myObj.code}"&gt;
                          &lt;h:outputText value="#{item.myObj.code}" style="float:left" /&gt;
  
                          &lt;p:commandButton id="selectBtn" icon="select"
                              oncomplete="selectDialog.show()" actionListener="#{controller.setMainItem}"&gt;
                              &lt;f:param name="selectedMainItem" value="#{item.id}"/&gt;
                          &lt;/p:commandButton&gt;
  
  
  
                  &lt;/p:column&gt;
  
  &lt;/p:dataTable
  &lt;/h:form&gt;
  &lt;/h:panelGroup&gt;
  
  &lt;p:dialog id="cl_selectDialog" header="Select AAAA" dynamic="true" modal="true" widgetVar="selectDialog" 
      height="500" width="900" showEffect="explode" hideEffect="explode"&gt;
  
          &lt;h:form id="selectForm" prependId="true"&gt;
  
              &lt;p:dataTable id="cl_selectGrid" var="selectorItem"    widgetVar="selectGrid"
                  value="# {controller.selectorItems}" selection="#{controller.selectedItem}" 
  rowKey="#{selectorItem.id}" selectionMode="single"&gt;
  
  
  
              &lt;p:commandButton actionListener="#{controller.processSelection}" value="Ok" icon="ui-icon ui-icon-search" 
                                      oncomplete="selectDialog.hide()" update=":mainTable" process="@form"/&gt;
              &lt;p:commandButton value="Cancel" icon="ui-icon ui-icon-search" onclick="selectDialog.hide()" type="button"/&gt;
          &lt;/h:form&gt;
      &lt;/p:dialog&gt;
  </code></pre>
  
  <p><strong>My Controller</strong></p>
  
  <p>In my controller all i am doing is hydrating my datatable again.</p>
  
  <pre><code>@Component
  @Scope("view")
  public class Controller extends BaseController implements Serializable {
  
  private List&lt;Item&gt; items;
  
  public Controller() {
      items = new ArrayList&lt;Item&gt;();  
  }
  
  
  @PostConstruct
  public void init() {
      loadItems();
  }
  
  protected void loadItems() {
      items = //Load items from Database
  }
  
  
  public void processSelection(ActionEvent event) {
      //Add the selected Item and then reload items
      loadItems();
  }
  
  }
  </code></pre>