Lazy loading multiple selection

UI Components for JSF
vea
Posts: 29
Joined: 12 Oct 2013, 06:27
Location: Netherlands

10 Oct 2014, 15:13

I've read some topics about lazy loading and multiple selection but don't get it to work.
I'm using PF 5.1 and my experience is that when skipping to the next page the selection list object is cleared.
So when an item is selected on the first page and an item is selected on the next page the selection list only contains the last selected.
Can anybody help me out with a clear working example?
Thanks in advance !!!!
Thanks in advance,
Arco
Using primefaces 5.1

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

11 Oct 2014, 11:19

You simply need to make the setter method for the selection list do nothing to keep track of offpage selections.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

vea
Posts: 29
Joined: 12 Oct 2013, 06:27
Location: Netherlands

14 Oct 2014, 07:51

andyba wrote:You simply need to make the setter method for the selection list do nothing to keep track of offpage selections.
If I do that my selection list is always empty no matter how many rows are selected.
Thanks in advance,
Arco
Using primefaces 5.1

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

14 Oct 2014, 17:32

then use ajax calls to add items to/delete items from your selection list (I personally always use the ajax way)

vea
Posts: 29
Joined: 12 Oct 2013, 06:27
Location: Netherlands

15 Oct 2014, 07:47

kukeltje wrote:then use ajax calls to add items to/delete items from your selection list (I personally always use the ajax way)
Ok almost there, this seems to work but the next scenario doesn't.
First select a row this is visually ok and the selected list contains one item.
After that select another row without holding the CTRL key, so visually one row is selected but the selected list contains two items.
Seems like the unselect event isn't fired for the row which is unselected by selecting another one.
Thanks in advance,
Arco
Using primefaces 5.1

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

15 Oct 2014, 10:44

What scope does the bean that holds the currently selected rows have?
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

15 Oct 2014, 10:51

Hmmm I would asume the scope is long enough since the selectEvent does work and the previously selected item is still there. I did not use multiple selection this way yet in 5.0/5.1, so I need to check it out myself. Could just be a bug.

vea
Posts: 29
Joined: 12 Oct 2013, 06:27
Location: Netherlands

15 Oct 2014, 14:57

The scope of the view is ViewScoped.
Like kukeltje said, the select and unselect events work when using the CTRL key but when selecting one row without CTRL no unselect events occur for the deselected rows.
Thanks in advance,
Arco
Using primefaces 5.1

vea
Posts: 29
Joined: 12 Oct 2013, 06:27
Location: Netherlands

17 Oct 2014, 13:31

Nobody using this ?
Thanks in advance,
Arco
Using primefaces 5.1

vea
Posts: 29
Joined: 12 Oct 2013, 06:27
Location: Netherlands

30 Oct 2014, 17:25

Anybody to help me out with this ?
Thanks in advance,
Arco
Using primefaces 5.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 57 guests