Question from a newbie. I have a screen where I need to display a table with the header split onto two rows and the data will be in two rows and sortby on one of the columns.
What it would look like is below (ignore the header column on the table) and would want to be able to sort the table by age
Header 1 | Header 2 | Header 3 |
---|
header row 1 name | age | gender |
header row continued on next line height | weight | hair color |
first row of data John | 30 | male |
6 feet | 200 lbs | brown |
second row of data Mary | 30 | female |
5 feet | 125 lbs | red |
The data displays ok in the solution I have now but once I put the sortby attribute on the age column it ends up creating a third row of header for the sort icon and in my example above it would put it under the weight header. What I have to display the table is very similar to the following example from the documentation but again when I put the sortby I have to put it on the h:outputText instead of the header column and this causes
the third row of header. What I would like is for the sort icon to be displayed with the header age. Anyone know how to do that. A table with two header rows and sortby one of the columne?
<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5" id="sublist">
<f:facet name="header">
<rich:columnGroup>
<rich:column rowspan="2">
<h:outputText value="State Flag"/>
</rich:column>
<rich:column colspan="3">
<h:outputText value="State Info"/>
</rich:column>
<rich:column breakBefore="true">
<h:outputText value="State Name"/>
</rich:column>
<rich:column>
<h:outputText value="State Capital"/>
</rich:column>
<rich:column>
<h:outputText value="Time Zone"/>
</rich:column>
</rich:columnGroup>
</f:facet>
<rich:column>
<h:graphicImage value="#{cap.stateFlag}"/>
</rich:column>
<rich:column>
<h:outputText value="#{cap.state}"/>
</rich:column>
<rich:column>
<h:outputText value="#{cap.name}"/>
</rich:column>
<rich:column>
<h:outputText value="#{cap.timeZone}"/>
</rich:column>
</rich:dataTable>
thanks in advance for all help