Datatable - save filter/sort state

UI Components for JSF
Post Reply
887662
Posts: 6
Joined: 29 Sep 2010, 23:54

18 Feb 2011, 02:43

Hi All,

When I return to a datatable, I would like the filters/sort to be like it was when I paged away. How do you save/restore the datatable state?

In addition, I would like to be able to set a filter value. For instance, I have just added a record to the table via another page. When I return to the table, I would like to set the filter value such that this new record appears.

Can anyone help me?

Using 2.2.1.

Thanks,
Judy

vanjadardic
Posts: 55
Joined: 08 Sep 2010, 09:18
Location: Banja Luka, Bosnia and Herzegovina
Contact:

16 Sep 2011, 08:50

887662 wrote:Hi All,

When I return to a datatable, I would like the filters/sort to be like it was when I paged away. How do you save/restore the datatable state?
Can we create an issue ticket for this?
PrimeFaces version: whatever is the latest
Mojarra version: whatever is the latest
GlassFish & Tomcat version: whatever is the latest
Chrome & Firefox version: whatever is the latest
And a little bit of IE

popeye
Posts: 8
Joined: 16 Nov 2010, 20:40

22 Sep 2011, 09:58

I have the same problem. Does anyone have solution for this?
Thanks!

Alexis
Posts: 4
Joined: 03 Sep 2012, 13:45

25 Sep 2012, 12:58

Hi,

I just found this post which is exactly why I'm trying to do. Is this still unanswered? Currently I could save the filters using:

Code: Select all

DataTable d = getTabComponent("....");
Map<String,String> storedFilters = d.getFilters()
and storing this in a attribute of a session scope backing bean. Then I can restore them using

Code: Select all

DataTable d = getTabComponent("....");
d.setFilters( storedFilters )
However, while the loaded table is correctly filtered, the filters values doesn't appear in the column headers, which is rather inconsistent.
Does anyone have an idea on how to do this?

Thanks

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Majestic-12 [Bot] and 30 guests