This content has been marked as final.
Show 2 replies
-
1. Re: Problem with h:graphicImage and rendered-attribute
keithnaas Feb 28, 2008 7:23 PM (in response to pete007)What does
#{content}
evaluate to? a String, a bean, a list?If its a String is it possibly an empty string?
Also, I would recommend using
#{empty content}
and#{not empty content}
'empty' checks to see if its null or empty (e.g., instance list, array or string).
null just seems so dirty in the view :)
-
2. Re: Problem with h:graphicImage and rendered-attribute
pete007 Feb 28, 2008 7:48 PM (in response to pete007)empty still doesn't work, I used it like this:
<ui:insert name="content" rendered="#{not empty content}"/> <h:graphicImage value="../images/layout/no_content.png" rendered="#{empty content}"/>
I think it gets evaluated to a String, but I'm not sure, how can I check this? Here's the definition if it helps in any way:
<ui:define name="content"> <h:form id="routerForm"> <table> <tr> <td> <h:graphicImage value="../images/floors/empty.png" rendered="#{router.startImage==null}"/> <h:graphicImage value="../images/#{router.startImage}" rendered="#{router.startImage!=null}"/> </td> <td> <h:graphicImage value="../images/floors/empty.png" rendered="#{router.endImage==null}"/> <h:graphicImage value="../images/#{router.endImage}" rendered="#{router.endImage!=null}"/> </td> </tr> </table> </h:form> </ui:define>
Yeah, I know, I should use empty here too. ;)