-
Notifications
You must be signed in to change notification settings - Fork 748
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: frozenColumns + draggableColumns + rendered content gets out of sync #11023
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@melloware to be honest, I do not fully understand the other ticket. I think the problem described in that ticket are related to dragging columns. In my case the problem happens without any dragging. The workaround I use in general is to reduce the frozen columns to 1 or prevent using 'rendered="false"' with columns. I also tried debugging into the PF Code, but I'm not that deep into it to propose solutions. I could see the in the DataTable Object, all columns are present, independently of being rendered or not, which is OK. But at some point the ordering of the columns gets confused. When debugging in ColumnAware.collectCollumns(), and set a breakpoint in columns.sort(c1, c2), you can see that columns which are not rendered have a displayPriority of 0, which causes them to be shifted to the top of the column list, and in the frozen area. |
I wonder if columns that are NOT rendered should get a priority of 999? |
I'm not sure if the priority of NOT rendered columns should be changed, as there might be actions which changes their 'render' attribute, and than they might be shifted to a position which is not desired. |
Runnable reproducer with |
@wlhUser its not Draggable Columns that is the issue... its |
Column order on first render:
Column Order on Update:
Notice Column4 is 2nd that is because in Map<String, ColumnMeta> columMeta = getColumnMeta();
columMeta.values().forEach(s -> s.setDisplayPriority(0)); However on first update with draggable columns it only sends the 4 visible columns from the client to decode column order which puts the order wrong which puts FrozenColumns=2 now incorrect. {
"form:testTable3_columnOrder": "form:testTable3:j_idt10,form:testTable3:j_idt12,form:testTable3:j_idt14,form:testTable3:j_idt18",
"javax.faces.ViewState": "-7232794966269752203:-2061201527638343433"
} |
Describe the bug
In DataTable with frozenColumns, draggableColumns and not rendered columns (rendered="false"), table header and content of table gets out of sync. Content is shifted 1 or 2 cols compared to header. This does not happen immediately when displaying the page, but after the 1st ajax update.
Example with 2 Data tables. The 1st has no not rendered columns while the 2nd has one. Otherwise the tables are identical.
Initial page:
![InitialPage](https://private-user-images.githubusercontent.com/47218021/285289850-01a20d41-95a8-4847-8df6-dbbbdb39b3d0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMzI4NjYsIm5iZiI6MTcyMDEzMjU2NiwicGF0aCI6Ii80NzIxODAyMS8yODUyODk4NTAtMDFhMjBkNDEtOTVhOC00ODQ3LThkZjYtZGJiYmRiMzliM2QwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDIyMzYwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk3OGZkNjVhNTdmZjcwMDUxOGM1YmM0YjFlN2EyMDhjN2JmMTY0NTNiN2JhY2IzNjIyNDgxNGU0NTk3NDQ5ZTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.i8Vf0Ysn1WTl2mzCrhvVhKMYKel9kbG4Ggdvn2tsd-8)
Now scroll down in both tables about 30%, and press the 'Update' button.
![PageAfterUpdate](https://private-user-images.githubusercontent.com/47218021/285290342-5d979f72-89ca-4e4e-b12f-c7ba5fc474e2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMzI4NjYsIm5iZiI6MTcyMDEzMjU2NiwicGF0aCI6Ii80NzIxODAyMS8yODUyOTAzNDItNWQ5NzlmNzItODljYS00ZTRlLWIxMmYtYzdiYTVmYzQ3NGUyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDIyMzYwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQxOGM4NGQ2NmU4NDJiYWU4YjQyMTVlYjExMzNhYzEwYzJkNDdkNzM3YzViYWQ3MjkxYjdhYzQ4YzQ0YzQ4ZGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.l3x2PepV9F6g0jGJ-zaT8lwV7AACGFigGEi78xtrANo)
The 1st table is still ok, while in the 2nd header and data are no longer in sync.
Reproducer
pf-11023.zip
Expected behavior
No response
PrimeFaces edition
Elite
PrimeFaces version
12.0.6
Theme
No response
JSF implementation
Mojarra
JSF version
4.0.4 (Wildfly30)
Java version
17
Browser(s)
All
The text was updated successfully, but these errors were encountered: