How to hide the h:dataTable header when no rows found

Hi...,How do I hide the H:dataTable column header where there are 0 rows retrieved.? Its looks bad when for the 1st time the page loads & there are no rows found after the query.Regards
[210 byte] By [pmohanana] at [2007-11-26 15:17:25]
# 1
Use the rendered attribute.<h:dataTable value="#{myBean.list}" var="item" rendered="#{!empty myBean.list}">
BalusCa at 2007-7-8 10:58:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks a lot!!! I have another Q. How do I hide/display section of the form in JSF depending on certain value like we can do in JSP. <% if (xyz ==1) {%>HTML Code<% }else {%>html code <% } %>
pmohanana at 2007-7-8 10:58:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

<h:panelGroup rendered="#{myBean.xyz == 1}">

...

</h:panelGroup>

<h:panelGroup rendered="#{myBean.xyz != 1}">

...

</h:panelGroup>

This can be any UIComponent however. Every JSF HTML component supports the rendered attribute.

BalusCa at 2007-7-8 10:58:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

Good you mentioned it, Balus! I wish to know whether there is a better way how to work out the conditional building of a final page rather than using the rendered attribute. Is a templating framework like facelets the only viable solution in this case? Are there any other approaches to deal with situation where the rendered attribute comes to mind? Just asking for references so I won't repeat these rendered's - one to include when it's true and another to exclude when it's false.

Jacek

JacekLaskowskia at 2007-7-8 10:58:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
This article might be interesting to dynamically include subviews: http://balusc.xs4all.nl/srv/dev-jep-djs.html
BalusCa at 2007-7-8 10:58:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...