This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes dynamic render? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "dynamic render?" Watch "dynamic render?" New topic
Author

dynamic render?

J Miller
Ranch Hand

Joined: Oct 21, 2010
Posts: 67
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

Joined: Apr 17, 2003
Posts: 327
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}"


Thanks, leo
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

Actually, the EL provides an easier way:



The "empty" EL operator returns true if the argument is null or an empty string.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic render?
 
Similar Threads
<rich:toolTip> problem.
Tooltips and command buttons
h:dataTable and rich:toolTip
Any solution for h:graphicImage using rich:toolTip
rich:tooltip is not showing mentioned color