• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic render?

 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to display or not display a <rich:toolTip> based on whether or not there is anything in the value field. A coworker at told me they believe there is something I can do similar to this:



That isn't the correct syntax, but it just conveys my idea. If you have a rich:toolTip where the value="", then it shows up as an empty box. So I only want it rendered if there's something in there. The idea is that the "value.isEmpty()" would return a true/false boolean based on whether or not #{bean.toolTip} returns anything.

Anybody got any idea if/how this can be accomplished?

Thanks!
 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Define the rendered value as an instance field and provide getters/setters.



You'll have to update the value of empty in your bean.toolTip method.

Then you can use: rendered="#{bean.isEmpty}"
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, the EL provides an easier way:



The "empty" EL operator returns true if the argument is null or an empty string.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic