• 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

how to make a column dynamic ?

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

I've tried to make my columns dynamic by using rendered property.
everything went fine except that the header values didn't show.
so, would please give some explanations about this issue ?

regards,

<rich:dataTable value="#{stationLoad.results}"
cellpadding="0" cellspacing="0"
width="700" border="0" var="record">
<rich:column>
<f:facet name="header">
<h:outputText value="Hour"/>
</f:facet>
<h:outputText value="#{record.time}"/>
</rich:column>
<rich:column rendered="#{record.mvar}">
<f:facet name="header">
<h:outputText value="MVAR"/>
</f:facet>
<h:outputText value="#{record.mvarValue}"/>
</rich:column>
<rich:column rendered="#{record.mw}">
<f:facet name="header">
<h:outputText value="MW"/>
</f:facet>
<h:outputText value="#{record.mwValue}"/>
</rich:column>
</rich:dataTable>
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tawfeeq,

What do you mean the header values aren't showing?

It looks like you're defining the header values inside component that you have the rendered tag on.

EG:


So the header value MVAR will not display as well as the value of record.mvarValue based on the value of record.mvar.

Am I understanding your question correctly?

Tjeers
Darryl
 
Tawfeeq Al-Moumen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Darryl Nortje,

sorry for not giving you more detail.

what I have noticed that there is no problem will happen to the column if the rendered property is false
but if the rendered property is true, it showed me the data and hide the header name.
[ November 10, 2008: Message edited by: Tawfeeq Al-Moumen ]
 
Tawfeeq Al-Moumen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any solution or idea for this problem ???
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This situation,I have ever come across.

The solution is below:

First,You should use rendered in
<rich:dataTable var="m" value="#{beanname.property}">
<rich:column>
<h:outputText id="" value="#{m.property}" rendered="#{m.property =='' ?ture:false}">

</rich:column>

my Msn:is renfeiyang123@live.cn. you can communicate with me.
 
reply
    Bookmark Topic Watch Topic
  • New Topic