Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Header, Footer with dynamic data

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks a lot...

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

Thanks you very much.
 
Lookout! Runaway whale! Hide behind this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic