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: Selection semantic for disabled rows #11290
Comments
Just clarifying is this a new issue in 13? Did it work in previous PF versions? |
Let me check... |
This issue #9552 changed the behavior (issue 3) |
OK I have a fix for 1 and 2. |
Your issue #3 is tricky and i think the current behavior is correct? Because if a HTML checkbox is disabled it does not send its value in a form submit. I think the previous behavior in 12.0.0 was actually incorrect/bug and if its disabled it should not be submitted.
|
I know an HTML checkbox behaves this way, but how can I solve following use case: |
The only way I can think of is to leave them enabled but write some JS code that sets them |
@melloware To demonstrate this let's look at two possible implementations of selections
The problem in 1) is not that the checkbox is not submitted (this is HTML |
I see what you are saying but it was done in #9552 to prevent the exact behavior you are saying you need. In My opinion disabled checkboxes should not update the backend. @tandraschko @jepsar @christophs78 @Rapster any thoughts here? |
Describe the bug
Using DataTable with a predefined selection causes multiple problems when there are items which are disabled with
disabledSelection
.Issue 1
The "select all" checkbox is not correctly checked when there are checked disabled items.
For example:
1 row is checked
1 row (disabled) is checked
1 row is unchecked
1 row (disabled) is unchecked
The "select all" checkbox for this example is checked, even if there is 1 row (enabled) which is unchecked.
Issue 2
It is possible to tab on a disabled checkbox, the focus therefore is then visible.
Issue 3
If the DataTable is submitted with a disabled row which is checked, then the selection on serverside is updated and dismisses the disabled checked row.
Reproducer
Issue 1
Issue 2
Issue 3
Expected behavior
Issue 1
The "select all" checkbox should only be checked, if all enabled checkboxes are checked
Issue 2
A disabled checkbox should not be focusable
Issue 3
If there is a predefined selection with a row which is a disabled checked row, the selection of the disabled checked row should not me dismissed
PrimeFaces edition
Community, Elite
PrimeFaces version
14.0.0-SNAPSHOT, 13.0.4
Theme
No response
JSF implementation
Mojarra
JSF version
2.2
Java version
8
Browser(s)
No response
The text was updated successfully, but these errors were encountered: