Hi, you have two options here, both of them imply not to render the
table when no results are returned:
#1 Use the attribute renderIfEmpty="true" of the t:dataTable [1]; then
use an h:outputText with the attribute rendered="#{empty
yourBean.yourData}"
#2 Use rendered="#{!empty yourBean.yourData} for the h:dataTable; and
then use the h:outputText with the attribute rendered="#{empty
yourBean.yourData}"
Regards,
Bruno
[1] http://myfaces.apache.org/tomahawk/extDataTable.html
2005/11/15, TRIFILETTI, Mel <[EMAIL PROTECTED]>:
>
> Hi
>
> I'm using a dataTable to display a List of results from a search, like
> the following
>
> <h:dataTable value="#{AuditHistory.auditHistory}" var="auditRecord"
> rowClasses="rowEven, rowOdd">
>
> If auditHistory is null or zero length I want to display a message in
> the table like:
> "Your search results returned zero items"
>
> Currently the dataTable outputs nothing, so I could add a <h:outputText>
> conditionally.
>
> Normally I would use a <c:if> but I think I am not allowed to mix <c:if>
> with JSF, and I don't think JSTL would know about the
> #{AuditHistory.auditHistory} mamanaged bean anyway.
>
> What is the best way of doing this?
>
> Mel
>
>
> "DISCLAIMER: This email, including any attachments, is intended only for use
> by the addressee(s) and may contain confidential and/or personal information
> and may also be the subject of legal privilege. If you are not the intended
> recipient, you must not disclose or use the information contained in it. In
> this case, please let me know by return email, delete the message permanently
> from your system and destroy any copies.
>
> Before you take any action based upon advice and/or information contained in
> this email you should carefully consider the advice and information and
> consider obtaining relevant independent advice.
>