wood burning stoves 2.0*
The moose likes JSF and the fly likes how to make a column dynamic ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "how to make a column dynamic ?" Watch "how to make a column dynamic ?" New topic

how to make a column dynamic ?

Tawfeeq Al-Moumen

Joined: Nov 08, 2008
Posts: 3
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 ?


<rich:dataTable value="#{stationLoad.results}"
cellpadding="0" cellspacing="0"
width="700" border="0" var="record">
<f:facet name="header">
<hutputText value="Hour"/>
<hutputText value="#{record.time}"/>
<rich:column rendered="#{record.mvar}">
<f:facet name="header">
<hutputText value="MVAR"/>
<hutputText value="#{record.mvarValue}"/>
<rich:column rendered="#{record.mw}">
<f:facet name="header">
<hutputText value="MW"/>
<hutputText value="#{record.mwValue}"/>
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
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.


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?

Tawfeeq Al-Moumen

Joined: Nov 08, 2008
Posts: 3
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

Joined: Nov 08, 2008
Posts: 3
any solution or idea for this problem ???
ren feiyang

Joined: Nov 16, 2008
Posts: 1
This situation,I have ever come across.

The solution is below:

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


my Msn:is renfeiyang123@live.cn. you can communicate with me.
I agree. Here's the link: http://aspose.com/file-tools
subject: how to make a column dynamic ?
Similar Threads
Header, Footer with dynamic data
h:dataTable and rich:toolTip
Simple expandable table with RichFaces
Rich:Datatable rerendering problem
Data from search not being dynamically added to rich:dataTable