title: Reset PrimeFaces DataTable state (filter, sorting, paging)
body: <p>I'd like to reset the filter, sort and paging state of an PrimeFaces DataTable. Unfortunately, there is no easy way to do so. Especially reseting the sort state is difficult.</p>
  
  <p>What I did until now is:</p>
  
  <pre><code>DataTable dataTable = (DataTable) FacesContext.getCurrentInstance().getViewRoot().findComponent(componentId);
  if (dataTable != null) {
      dataTable.setSortOrder("ascending");  // reset sortOrder
      dataTable.setFirst(0);                // reset page
      dataTable.setFilteredValue(null);     // reset filter
      dataTable.setFilters(null);
  }
  </code></pre>
  
  <p>I'm using PrimeFaces 3.4.1.</p>