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 Display the content of a variable without <h:outputText>? 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 "Display the content of a variable without <h:outputText>?" Watch "Display the content of a variable without <h:outputText>?" New topic
Author

Display the content of a variable without <h:outputText>?

Fabian Angy
Ranch Hand

Joined: Oct 27, 2008
Posts: 90
Hi!

At this moment, I use <h: outputText value="#{bean.informations}", in this variable I have some HTML code with all informations to display. But now, I need to include some <rich:tooltip>" but if I put in my variable "<rich:tooltip ...>" with <h: outputText> it doesn't work.

There is another way to display that without outputText? (is it simply possible?)

I display my informations like this:


My "informations" contains:


And I would like to display



Thanks in advance!


SCJP 5
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

Tooltips are intended to provide hints on how to use input controls. That's why they don't work on outputText. You can, however, attach a CSS hover pop-up to the outputText the same way you with with straight HTML.

Speaking of straight HTML, I don't recommend mixing raw HTML and JSF. However, in the case of "span" tags around outputText, it's not merely not recommended, it's actually redundant. The outputText HTML renderer places span around the text so that it will have a place to put the style/styleClass values that were coded on the outputText tag.


Customer surveys are for companies who didn't pay proper attention to begin with.
Fabian Angy
Ranch Hand

Joined: Oct 27, 2008
Posts: 90
In fact, I need to use rich:tooltip because my informations comes from webservices, in waiting the retrieving of informations, i need to have a message (by example "webservice is calling") and when the webservice returns the information, the value of the tooltip have to change. So, I can't do that with a simple CSS.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

Fabian Angy wrote:In fact, I need to use rich:tooltip because my informations comes from webservices, in waiting the retrieving of informations, i need to have a message (by example "webservice is calling") and when the webservice returns the information, the value of the tooltip have to change. So, I can't do that with a simple CSS.


Actually, you can. Put the text in a floating div element and use JavaScript to populate it with the text from the web service. Then attach "hover" javascript to the outputText element that positions the div and makes it visible/invisible. It's not that uncommon.

However, for best results, "tooltip" isn't a good search term, since a tooltip is - like I said - literally a tip on how to use an (input) tool (control). You'll probably get better results searching for "hover text".
 
Don't get me started about those stupid light bulbs.
 
subject: Display the content of a variable without <h:outputText>?
 
Similar Threads
UIParameter issue in HtmlDataTable
Ajax status doesn't stop in IE8
Rich:Datatable rerendering problem
<rich:tooltip>
How to get aroun LazyInitialization exceptions using Spring HibernateDaoSupport?