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 table completly if it’s empty?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Make use of the
renderedattribute. It accepts a boolean expression. You can evaluate the datatable’s value inside the expression with help of the EL’semptykeyword. If it returnsfalse, the whole component (and its children) won’t be rendered.For the case you’re interested, here are other basic examples how to make use of the EL powers inside the
renderedattribute:See also: