I have to display a two dimensional table with a great number of columns and rows and the two dimensions are not fixed. Using JSF2 dataTable there is the constraint that the number of colums cannot be dynamic: each coloumn must have the proper jsf tag .
Is there a way to insert the columns programmatically as for the rows in the dataTable?
Also panelGrid does not suit because you have to specify and write all the tags by hand.
I prefer not to use javascript to create such a component, I would like to exploit JSF2 as much as possible.
I have to display a two dimensional table with a great number of columns
Share
The standard JSF component set does not have such a component where it would be logically named
<h:columns>. There exist however 3rd party component libraries which have such a component. For example, Tomahawk with<t:columns>and PrimeFaces with<p:columns>. The Tomahawk components doesn’t generate any additional look’n’feel, so this is perfect if you want full control over CSS yourself. The PrimeFaces one generates a customizeable look’n’feel with help of CSS themeroller framework, so this is perfect if you want to utilize themeroller to manage look’n’feel.Here’s an example of how you could use Tomahawk’s
<t:columns>, copied and slightly changed from its tag documentation: