aspose file tools*
The moose likes JSF and the fly likes Showing ' No Records available' message in a h:dataTable    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Showing Watch "Showing New topic
Author

Showing ' No Records available' message in a h:dataTable

Francis Lukose
Greenhorn

Joined: Aug 03, 2005
Posts: 4
Hi ,

I am using JSF dataTable to show my data in tabular format. The data is comming from a database. And everything is working finely.
But I would like to show a message like " No Records Available" in the dataTable if there has no data to be shown.

Is it possible to show these type of messages in a dataTable?

Could anybody please give a solution?


Regards,
Francis
Ravindra Rawat
Ranch Hand

Joined: Dec 09, 2004
Posts: 34
Hi Francis,



If you are using myfaces,
use renderedIfEmpty="false" (Why, checkout the taglib documentation)

If some other implementation.
rendered="#{bean.size != 0}"

After this you can have a outputText component which is has

rendered="#{bean.size == 0}" and the message you want to display on no records.

In short, use the rendered attribute.

Warm Regards
Ravindra
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Showing ' No Records available' message in a h:dataTable