How to fully reinialize a dataTable based on multiViewState?

UI Components for JSF
Post Reply
DazzlingBob
Posts: 7
Joined: 07 Mar 2019, 15:20

11 Oct 2021, 00:21

In a project we have been using the dataTable component (non lazy) for CRUD with filtering/sorting and multiViewState.
Some how after a series of manipulation actions the visually representation of the dataTable sort/filter will get messed up.
A full page refresh (non ajax) seems to fix the issue (multiViewState is restored). Working on a fully-reproducible example.

As a workaround i am trying to fully reinialize the table sort/filter/cache/... instance state based on the stored multiViewState state.

Something like:

Code: Select all

DataTable dataTable = (DataTable) FacesContext.getCurrentInstance().getViewRoot().findComponent("form:datatable");
dataTable.reset();
...
Has someone dealt with this before?
Using primefaces 10.0.7 (latest version) and mojarra23.

Melloware
Posts: 2929
Joined: 22 Apr 2013, 15:48

16 Oct 2021, 13:34

We do exactly what you do above in our projects and it works. It removes all sorting and filtering.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 10.0.7 / PF Extensions 10.0.6
PrimeReact 7.0.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Robertelite and 17 guests