• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Header, Footer with dynamic data

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to display dynamic header, dynamic footer, with dynamic data in column.
I tried with following code:

<rich:dataTable id="report" value="#{viewClass.resultList}" var="list">
<f:facet name="header">
<rich:columnGroup>
<rich:column>
<a4j:commandLink value="Header1" actionListener="#{viewClass.sortTable}"/>
</rich:column>
<rich:column>
<h:outputText value="Header2" />
</rich:column>
<rich:column>
<h:outputText value="Header3" />
</rich:column>
<rich:column>
<h:outputText value="Header4" />
</rich:column>
<rich:column>
<h:outputText value="Header5" />
</rich:column>
<rich:column>
<h:outputText value="Header6" />
</rich:column>

</f:facet>
<rich:subTable value="#{viewClass.resultList}" var="item1" >
<rich:column>
<h:outputText value="#{item1.header1}"></h:outputText>
</rich:column>

<rich:column>
<h:outputText value="#{item1.header2}"></h:outputText>
</rich:column>

<rich:column>
<h:outputText value="#{item1.header3}"></h:outputText>
</rich:column>

<rich:column>
<h:outputText value="#{item1.header4}"></h:outputText>
</rich:column>

<rich:column>
<h:outputText value="#{item1.header5}"></h:outputText>
</rich:column>

<rich:column>
<h:outputText value="#{item1.header6}"></h:outputText>
</rich:column>
</rich:subTable>

<f:facet name="footer">
<rich:columnGroup>
<rich:column>
<rich:spacer></rich:spacer>
</rich:column>
<rich:column rowspan = 2>Totals</rich:column>
<rich:column>
<h:outputText value="#{viewClass.tot1}"></h:outputText>
</rich:column>
<rich:column>
<h:outputText value="#{viewClass.tot2}"></h:outputText>
</rich:column>
<rich:column>
<h:outputText value="#{viewClass.tot3}"></h:outputText>
</rich:column>
<rich:column>
<h:outputText value="#{viewClass.tot4}"></h:outputText>
</rich:column>
</rich:columnGroup>
</f:facet>

</rich:dataTable>

But Output is coming as :

Header1 Header2 Header3 Header4 Header5 Header6
a1 a2 a3 a4 a5 a6
b1 b2 b3 b4 b5 b6
c1 c2 c3 c4 c5 c6
a1 a2 a3 a4 a5 a6
b1 b2 b3 b4 b5 b6
c1 c2 c3 c4 c5 c6
a1 a2 a3 a4 a5 a6
b1 b2 b3 b4 b5 b6
c1 c2 c3 c4 c5 c6
Total 12 23 45 22

Same data got repeated 3 times for 3 sets of records, 4 times for 4 sets of record i.e n times for n set of records..

Someone Please please please respond and help.


 
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your headers and data should be in the same column, not separated.
 
Raja Pam
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot...

Done in the same way... Issue is resolved...

Thanks you very much.
reply
    Bookmark Topic Watch Topic
  • New Topic