aspose file tools*
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
Author

how to make a column dynamic ?

Tawfeeq Al-Moumen
Greenhorn

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 ?

regards,

<rich:dataTable value="#{stationLoad.results}"
cellpadding="0" cellspacing="0"
width="700" border="0" var="record">
<rich:column>
<f:facet name="header">
<hutputText value="Hour"/>
</f:facet>
<hutputText value="#{record.time}"/>
</rich:column>
<rich:column rendered="#{record.mvar}">
<f:facet name="header">
<hutputText value="MVAR"/>
</f:facet>
<hutputText value="#{record.mvarValue}"/>
</rich:column>
<rich:column rendered="#{record.mw}">
<f:facet name="header">
<hutputText value="MW"/>
</f:facet>
<hutputText value="#{record.mwValue}"/>
</rich:column>
</rich:dataTable>
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.

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

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
Greenhorn

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

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}">
<rich:column>
<hutputText id="" value="#{m.property}" rendered="#{m.property =='' ?ture:false}">

</rich:column>

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 ?