3 Replies Latest reply on Oct 8, 2010 10:37 AM by ilya_shaikovsky

    Nested Tooltips not working

    jjmiller

      I'm having a problem with the <rich:toolTip> component.  If I use it in this way it works:


      ...
      <h:outputText value="Name: " id="nameId">
           <rich:toolTip showEvent="onmouseover" for="nameId">
                <span> This is my tooltip </span>
           </rich:toolTip>
      </h:outputText>
      ...

      ...

      <h:outputText value="Name: " id="nameId">

           <rich:toolTip showEvent="onmouseover" for="nameId">

                <span> This is my tooltip </span>

           </rich:toolTip>

      </h:outputText>

      ...


      But if I simply nest it without using the "for" and "id" parameters like shown below it doesn't work.


      ...

      <h:outputText value="Name: ">

           <rich:toolTip showEvent="onmouseover">

                <span> This is my tooltip </span>

           </rich:toolTip>

      </h:outputText>

      ...


      We are using RichFaces pretty heavily, and this is the only component that doesn't seem to be working. 


      Any ideas?

        • 1. Re: Nested Tooltips not working
          ilya_shaikovsky

          add id back to the outputText and it will works. The same should be done for image for example if present. The reason pretty simple and not related to tooltip itself - those components does not encode  id being rendered  - so tooltip can't be attached.

          • 2. Re: Nested Tooltips not working
            jjmiller

            Ah, you're absolutely correct.  I didn't realize that it was a requirement that the parent have an ID. In my pages, I will have sections that will loop 3 or more times, and you can't have the same ID more than once in a page without breaking the page.  So I suppose I'll just use the "title" attribute to create my tooltips rather than using richfaces.  Still, that's a good thing to know, and thanks for the help!

            • 3. Re: Nested Tooltips not working
              ilya_shaikovsky

              iteration components like tables repeats and so on and actually add iteration id to clientId so it will be not a problem, if using JSTL forEach - you should add iteration id manually.