How do I display a message if a jsf datatable is empty?

前端 未结 2 1177
野性不改
野性不改 2020-12-12 14:55

Using JSF1.2, if my datatable binding returns no rows I want to display a message saying so.

How do I do that?

And for extra points - how do I hide the tabl

2条回答
  •  醉酒成梦
    2020-12-12 15:19

    You can test this in several ways, for example by having a function in a bean that tests the list size:

    function boolean isEmpty() {
        return myList.isEmpty();
    }
    

    then in the JSF pages :

    
    
    
    ...
    
    

提交回复
热议问题