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 !!!!
Lazy loading multiple selection
- andyba
- Expert Member
- Posts: 2473
- Joined: 31 Mar 2011, 16:27
- Location: Steinfeld, near Bremen/Osnabrück, DE
- Contact:
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
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
If I do that my selection list is always empty no matter how many rows are selected.andyba wrote:You simply need to make the setter method for the selection list do nothing to keep track of offpage selections.
Thanks in advance,
Arco
Using primefaces 5.1
Arco
Using primefaces 5.1
Ok almost there, this seems to work but the next scenario doesn't.kukeltje wrote:then use ajax calls to add items to/delete items from your selection list (I personally always use the ajax way)
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
Arco
Using primefaces 5.1
- andyba
- Expert Member
- Posts: 2473
- Joined: 31 Mar 2011, 16:27
- Location: Steinfeld, near Bremen/Osnabrück, DE
- Contact:
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
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
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.
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.
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
Arco
Using primefaces 5.1
-
- Information
-
Who is online
Users browsing this forum: No registered users and 57 guests