Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable: detects automatically selectionMode based on selection VE/value #10129

Closed
Rapster opened this issue May 14, 2023 · 0 comments · Fixed by #10130
Closed

DataTable: detects automatically selectionMode based on selection VE/value #10129

Rapster opened this issue May 14, 2023 · 0 comments · Fixed by #10130
Assignees
Milestone

Comments

@Rapster
Copy link
Member

Rapster commented May 14, 2023

Description

Just like DataTable#lazy, it should be possible to determine selectionMode value (single, mutiple) based on selection VE or value. If a Collection, we can assume it's multiple selection, otherwise single

Describe the solution you would like

Automatic single selection (selectedProduct being a single object):

<p:dataTable var="product" value="#{dtSelectionView.products}" selection="#{dtSelectionView.selectedProduct}">

</p:dataTable>

Will enable single selection

Automatic multiple selection (selectedProducts being a collection of object):

<p:dataTable var="product" value="#{dtSelectionView.products}" selection="#{dtSelectionView.selectedProducts}">

</p:dataTable>

Will enable multiple selection

@Rapster Rapster added this to the 13.0.0 milestone May 14, 2023
@Rapster Rapster self-assigned this May 14, 2023
Rapster added a commit to Rapster/primefaces that referenced this issue May 14, 2023
@Rapster Rapster modified the milestones: 13.0.0, 14.0.0 May 14, 2023
tandraschko pushed a commit that referenced this issue May 16, 2023
…selection VE/value (#10130)

* Fix #10129 - DataTable: detects automatically selectionMode based on selection VE/value

* wrong commit

* fix resolveSelectionMode

* docs

---------

Co-authored-by: Melloware <mellowaredev@gmail.com>
Rapster added a commit that referenced this issue May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant