Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Francis Lukose
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic