• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Saloon Keeper
Posts: 28074
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Fabian Angy
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 28074
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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".
 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic