-
1. rich:dataTable how to print column headers multiple times
ilya_shaikovsky Mar 11, 2011 2:32 AM (in response to cavinator)so the header should appear above every subtable columns? I checked under 3.3.3 and wortks fine for me.
-
2. rich:dataTable how to print column headers multiple times
cavinator Mar 15, 2011 3:05 PM (in response to ilya_shaikovsky)yes and that is the version i have too. Currently, my temporary solution is to have <ui:repeat> wrap around <rich:dataTable> as shown below. Would you show me your solution?
<ui:repeat value="{_travelLogs}" var="_log"> <!-- get a list of all the travel logs -->
<rich:dataTable value="{ get one record of travel log at a time feeded by _log} var="_travelLog" ...>
...
<rich:subTable id="travelLeg" value="_travelLog.travelLegs"
...
</rich:subTable>
</rich:dataTable>
</ui:repeat>
thank you,
Cavin
-
3. rich:dataTable how to print column headers multiple times
ilya_shaikovsky Mar 17, 2011 5:15 AM (in response to cavinator)with that code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<rich:dataTable
onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
cellpadding="0" cellspacing="0"
width="700" border="0" var="record" value="#{report.expReport.records}">
<f:facet name="header">
<rich:columnGroup>
<rich:column rowspan="2">
<rich:spacer />
</rich:column>
<rich:column colspan="3">
<h:outputText value="Expenses" />
</rich:column>
<rich:column rowspan="2">
<h:outputText value="subtotals" />
</rich:column>
<rich:column breakBefore="true">
<h:outputText value="Meals" />
</rich:column>
<rich:column>
<h:outputText value="Hotels" />
</rich:column>
<rich:column>
<h:outputText value="Transport" />
</rich:column>
</rich:columnGroup>
</f:facet>
<rich:column colspan="5">
<h:outputText value="#{record.city}" /></rich:column>
<rich:subTable
onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
var="expense" value="#{record.items}">
<rich:column>
<f:facet name="header">day</f:facet>
<h:outputText value="#{expense.day}"></h:outputText>
<f:facet name="footer">
<rich:spacer />
</f:facet>
</rich:column>
<rich:column>
<f:facet name="header">meals</f:facet>
<h:outputText value="#{expense.meals}"><f:convertNumber pattern="$####.00" /></h:outputText>
<f:facet name="footer">
<h:outputText value="#{record.totalMeals}"><f:convertNumber pattern="$####.00" /></h:outputText>
</f:facet>
</rich:column>
<rich:column>
<f:facet name="header">hotels</f:facet>
<h:outputText value="#{expense.hotels}"><f:convertNumber pattern="$####.00" /></h:outputText>
<f:facet name="footer">
<h:outputText value="#{record.totalHotels}"><f:convertNumber pattern="$####.00" /></h:outputText>
</f:facet>
</rich:column>
<rich:column>
<f:facet name="header">transport</f:facet>
<h:outputText value="#{expense.transport}"><f:convertNumber pattern="$####.00" /></h:outputText>
<f:facet name="footer">
<h:outputText value="#{record.totalTransport}"><f:convertNumber pattern="$####.00" /></h:outputText>
</f:facet>
</rich:column>
<rich:column>
<rich:spacer></rich:spacer>
<f:facet name="footer">
<h:outputText value="#{record.total}"><f:convertNumber pattern="$####.00" /></h:outputText>
</f:facet>
</rich:column>
</rich:subTable>
<f:facet name="footer">
<rich:columnGroup>
<rich:column>Totals</rich:column>
<rich:column>
<h:outputText value="#{report.expReport.totalMeals}"><f:convertNumber pattern="$####.00" /></h:outputText>
</rich:column>
<rich:column>
<h:outputText value="#{report.expReport.totalHotels}"><f:convertNumber pattern="$####.00" /></h:outputText>
</rich:column>
<rich:column>
<h:outputText value="#{report.expReport.totalTransport}"><f:convertNumber pattern="$####.00" /></h:outputText>
</rich:column>
<rich:column>
<h:outputText value="#{report.expReport.grandTotal}"><f:convertNumber pattern="$####.00" /></h:outputText>
</rich:column>
</rich:columnGroup>
</f:facet>
</rich:dataTable>
</ui:composition>
getting:
-
4. rich:dataTable how to print column headers multiple times
cavinator Apr 18, 2011 1:39 PM (in response to ilya_shaikovsky)Thank you Ilya, but you missed understood me. I want to reprint the headings from the rich:dataTable. Assumed the headings in your rich:dataTable is not "Meals", "Hotels", and "Transport". but one column call "Location". I want to print that heading "Location" above "San Jose" and right ablove "Seattle". Everything else keep the same (ie. the rich:subtable still have the heading "day", "meals", "hotels" and "transport").
Thank you,
Cavin