I have a JSR-168 portlet application in which some portlets use a JSF dataTable.
All data tables have an attribute like:
columnClasses="wpsTableDataStart,,,,wpsTableDataEnd"
with the number of classes matching the number of columns in the table.
The app was originally installed on WebSphere Portal 6.0.
On that server version, HTML generated for data tables always has “wpsTableDataStart” as the class on the first column, “wpsTableDataEnd” as the class on the last column, and no class on other columns. This is what I’d expect from reading about dataTable attributes.
I’ve recently installed the same application on WebSphere Portal 7.0.
I had to upgrade project facets in Rational Application Developer and change some class references in the “faces-config.xml” file to make the app work, and it’s now producing different HTML for dataTable column classes.
Instead of only having classes on the first and last column of the table, the two non-blank classes are being alternated.
I.e. the first column has the “wpsTableDataStart” class, the second column has the “wpsTableDataEnd” class, and other columns alternate those classes.
How do I make the columnClasses attribute behave as it did on Portal 6.0?
Solved by changing blank classes to spaces. E.g. the following produces the desired result on WebSphere Portal 7.0: