Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use tooltip in Struts2

 
abi chitnis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- 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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic