columns and "multi line" header
-
- Posts: 409
- Joined: 28 Dec 2011, 17:44
Sorry you're right. columnClasses is only for panelGrid. rowStyleClass for rows and on each column styleClass for columns should work.
Primefaces 8.0.7 (PF Extensions 8.0)
JSF: Mojarra 2.3.2 (Spec 2.3) - running on WildFly 22
JSF: Mojarra 2.3.2 (Spec 2.3) - running on WildFly 22
- mtranchant
- Posts: 20
- Joined: 04 Apr 2012, 12:59
- Location: France
- Contact:
That works great with styleClass. Thank you !
JBossAS 7.1.1.Final - Mojarra 2.1.7 (Mojarra 2.1.7-jbossorg-1 (20120227-1401)) - PrimeFaces 3.3.1 (with theme bluesky 1.0.6) - PrimeFaces Extension 0.5.1
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Can you share your solution/workaround to satisfy your multi-line header requirement?mtranchant wrote:That works great with styleClass. Thank you !
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
- mtranchant
- Posts: 20
- Joined: 04 Apr 2012, 12:59
- Location: France
- Contact:
I am afraid I have changed my way.
With that as a beginning
I have tested and implemented with an inner dataTable, but I found it made the main table not clear.
The code was:
Another solution I have explored it to merge restOfHeader at the beginning of tabDataList, so the rest of the headers are considered as "normal" cells. You just have to applies them the style "ui-widget-header".
I was not so bad. A good alternative.
Finally I've concatened all my lines in the first cell, that's all...
For that, I walk in my 2 dimensionnal array ([][]) horizontally and vertically to concat the headers in one.
So I am able to use sort options, for example.
Hope it will help.
Regards
With that as a beginning
Code: Select all
List<List<String>> tabDataList // contains the data and the "row headers" of the table
List<ColumnModel> tabHeaderModel // contains the first line of column headers
List<List<String>> restOfHeader // contains the rest of the lines of columns headers
I have tested and implemented with an inner dataTable, but I found it made the main table not clear.
The code was:
Code: Select all
<p:dataTable var="data" value="#{mainController.view.tabDataList}" id="tabularView">
<p:columns value="#{mainController.view.tabHeaderModel}" var="column" columnIndexVar="colIndex">
<f:facet name="header">#{column.header}
<p:dataTable var="datacol" column="1" value="#{mainController.view.restOfHeader[colIndex]}" rendered="#{colIndex ne null}">
<p:column styleClass="ui-widget-header">
#{datacol}
</p:column>
</p:dataTable>
</f:facet>
#{data[colIndex]}
</p:columns>
</p:dataTable>
I was not so bad. A good alternative.
Finally I've concatened all my lines in the first cell, that's all...
For that, I walk in my 2 dimensionnal array ([][]) horizontally and vertically to concat the headers in one.
So I am able to use sort options, for example.
Hope it will help.
Regards
JBossAS 7.1.1.Final - Mojarra 2.1.7 (Mojarra 2.1.7-jbossorg-1 (20120227-1401)) - PrimeFaces 3.3.1 (with theme bluesky 1.0.6) - PrimeFaces Extension 0.5.1
-
- Information
-
Who is online
Users browsing this forum: No registered users and 50 guests