This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes How to use tooltip in Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to use tooltip in Struts2" Watch "How to use tooltip in Struts2" New topic
Author

How to use tooltip in Struts2

abi chitnis
Greenhorn

Joined: Feb 13, 2009
Posts: 11
Hi

I want to use tooltip functionality with anchor tag so that when user hovers over the link it will popup saml box with description of that link. I tried following but I am not much familiar with tooltip concept.



Any sample code or help in this matter is really appreciated.

Thank you,
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

- Which version of Struts 2? Tooltips have changed over time.
- Do you have the <s:head/> tag in the <head> of your document? You need it.
- Are you getting any JavaScript errors? Have you checked using a tool like Firebug?
- Are you saying what you're doing doesn't work? If so, what specifically doesn't work?
abi chitnis
Greenhorn

Joined: Feb 13, 2009
Posts: 11
I am really not familiar with the concept of tooltip, so please excuse my ignorance. Following is the jsp I have and when I move the mouse over link I do not see any tooltip or popup. I am using struts2.1.6 and do not have <s:head> tag. What do I need to put it in <s:/head> tag?

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

My mistake; you don't (strictly) need the <s:head/> tag; the tooltip JavaScript include is emitted by the closing form tag.

Looking through the form tag templates it looks like there's a property "jsTooltipEnabled" that must be set to "true" for the JavaScript tooltips to work. I'm not sure if you need to set that for every tag (which seems horrible) or set it on the enclosing <s:form...> tag--I'd try the form tag first.

If adding that property to the form or individual element tags doesn't work then I'm not sure; there might be a problem with either the tag(s), the documentation, or something else.

Again, it'd be really helpful to know if there are any JavaScript errors. These are most easily visible using something like Firebug under Firefox.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use tooltip in Struts2