Hi,
I have requirement to use single selection and multiple selection on same table.
I have one table on left hand side of page and depending upon users selection (single row selection or multiple row selection) I need to update right hand side of page.
If user select just one row then I have to display view A and if user select multiple rows (more than one) then I have to display view B.
I know that in primefaces table i can have single selection or multiple slecetion mode on table but as per my requirement i have to combine both of same table.
Any idea how this can be achived ?
Thanks
Use selectionMode as "single" and "multiple" for same table
I am currently doing that but the problem with this aproch is :
When user selecet 10 rows and then he wants to select only one row then in order to do that he need to "Unselect" other remaining 9 rows first.
So form useablility prospective it not user firendly.
When user selecet 10 rows and then he wants to select only one row then in order to do that he need to "Unselect" other remaining 9 rows first.
So form useablility prospective it not user firendly.
Primeface 3.2 | Tomcat 7.0.21 | MyFaces 2.1.5 | Eclipse 3.7 | CentOs 5.6
One option is this: http://primefaces.prime.com.tr/forum/vi ... =3&t=12348
Hi mitnpatel,
I didn't totally understand why you need "single selection and multiple selection on same table". Try with multi-selection. If user selected one row - view A, if more - view B. The check is easy done if you process the table or use instant row selection. What is the problem?
I didn't totally understand why you need "single selection and multiple selection on same table". Try with multi-selection. If user selected one row - view A, if more - view B. The check is easy done if you process the table or use instant row selection. What is the problem?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
There is no built-in way, it is either one or the other unless you hack/extend it somehow.
Ok, I see. I have done this quite simple and user-friendly in one of my web applications (no PrimeFaces, Struts and my own table implementation). My proved approach is:
1) Selection is done either by checkboxes or row click.
2) By checkboxes you can select multiply rows. Rows are also highlighted.
3) By click on a row all previous selected rows get deselected. This is a single selection then.
See screenshots
Multi-Selection
Single-Selection (the same table)
Edit: And my context menu on a table (right mouse click) is aware of selected rows and is built up dynamically on the client-side only I'm missing that all in PrimeFaces, so that some hacks are needed in the future.
1) Selection is done either by checkboxes or row click.
2) By checkboxes you can select multiply rows. Rows are also highlighted.
3) By click on a row all previous selected rows get deselected. This is a single selection then.
See screenshots
Multi-Selection
Single-Selection (the same table)
Edit: And my context menu on a table (right mouse click) is aware of selected rows and is built up dynamically on the client-side only I'm missing that all in PrimeFaces, so that some hacks are needed in the future.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
-
- Information
-
Who is online
Users browsing this forum: No registered users and 53 guests