DataTable: Column widths get corrupted
See original GitHub issueDescribe the defect In a dataTable with resizable columns, the column width is OK when the table is displayed initially, but gets messed up (made much too small) when refreshing the table one or two times via ajax.
Environment:
- PF Version: 10.0.1
- JSF + version: Mojarra 2.3
- Affected browsers: ALL
To Reproduce
I do not have an example to reproduce, but I debugged the code, and think I discovered the problem.
Please have a look at DataTableRenderer.java line 629 ff.
if (columnMeta != null && columnMeta.getWidth() != null) { width = columnMeta.getWidth(); }
When debugging and taking a look at columnMeta.getWidth(), I find cases where it contains the String “null”, not null.
As result the width of the respective columns is being set to the String “null”, which leads in the end to corrupted column widths.
Please have a look at ColumnMeta.setWidth, and make sure it does not allow setting false content.
For myself, I could fix this at another place in my code, just by fetching the list of ColumnMeta objects from the dataTable, and replacing “null” with null in the width attribute.
Hope my explanation is understandable even without an example.
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (10 by maintainers)
Top GitHub Comments
Please provide a reproducer.
@wlhUser Thanks for reporting this and providing me with the example to fix it. I would have had a tough time reproducing it without it!