Joffrey Hernandez
Joffrey Hernandez

Reputation: 1846

Hide Empty Datatable PrimeFaces

I work on glassfish 3.1 with Primefaces. And i need to hide a dataTable if she is empty for display a error message.

But i can't hide a DataTable in the view.

Anyone can give me an exemple for help me ?

Thanks

Upvotes: 0

Views: 5748

Answers (1)

tomi
tomi

Reputation: 716

You can use style attribute:

style="display:block;"

when data found or:

style= "display:none";

when data not found.

You can also use renderen attribute:

<p:dataTable rendered="#{bean.dataFound}"

Upvotes: 3

Related Questions