my dog learned polymorphism*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
Consider Paul's rocket mass heater.
 
subject: Showing ' No Records available' message in a h:dataTable
 
Similar Threads
NX: methods problem in DBMain is puzzling me!
Print " No records Found " when no data record is available in database.
DataTable with DataScroller issue
JSF Dynamic Tables - AJAX
JSF - Passing value from a SelectOneCheckBox to a command button