Reset PrimeFaces DataTable state (filter, sorting, paging)
Inside the LazyDataModel load I call the method with this code:
DataTable dataTable = (DataTable) FacesContext.getCurrentInstance().getViewRoot().findComponent("form:dataTableItem");
dataTable.setFirst(0);
dataTable.reset();
dataTable.setSortBy(null);
dataTable.setSortBy(null);
I'm using PrimeFaces 4.0
Finally, I found the solution, hidden in this sample http://www.primefaces.org/showcase/ui/data/datatable/columns.xhtml on tab ColumnsView.java
:
table.setValueExpression("sortBy", null);