How do I display a message if a jsf datatable is empty?
Make use of the rendered attribute. It accepts a boolean expression. You can evaluate the datatable’s value inside the expression with help of the EL’s empty keyword. If it returns false, the whole component (and its children) won’t be rendered. <h:outputText value=”Table is empty!” rendered=”#{empty bean.list}” /> <h:dataTable value=”#{bean.list}” rendered=”#{not empty bean.list}”> … </h:dataTable> For … Read more