9 Replies Latest reply on Jan 25, 2013 8:57 AM by Roberto Cordoba

    Tooltip only works inside a panel?

    Tom Giberius Newbie

      Tooltip inside a panel is working, inside an inputText not working. The whole construction is inside a form.

       

      <h:panelGrid>

              <rich:panel>

                   <rich:tooltip>

                          This works!

                   </richt:tooltip>

               </rich:panel

      <h:panelGrid>

       

      <h:inputText value=...>

                 <rich:tooltip>

                     This does not work

                 </rich:tooltip>

      </h:inputText>

       

      Documentation says: A tooltip can be applied to any control and is applied when hovering the mouse over the control.

       

      I also tried <a4j:commandButton>, no result only contruction with panel seems to work.

      Am I doing something wrong?

        • 1. Tooltip only works inside a panel?
          Nick Belaevski Master

          Hi Tom,

           

          No, that's a limitation of tooltip component. You can wrap it into a4j:outputPanel.

          1 of 1 people found this helpful
          • 2. Tooltip only works inside a panel?
            Siva P Master

            Hi Tom,

             

            Try like this it will work.....

                              

                                     <h:inputText id="filterID" size="28" value="">

                                          <rich:toolTip for="filterID" value="Plese Enter"></rich:toolTip>

                                     </h:inputText>

            • 3. Tooltip only works inside a panel?
              Tom Giberius Newbie

              I am working with richfaces 4.0.0

               

              toolTip and for does not exist in release 4.0.0, I think this is from release 3.3.

               

              In 4.0.0 you have tooltip and attribut target , I followed up your advise for this equivalent but the result was negative.

              • 4. Re: Tooltip only works inside a panel?
                Tom Giberius Newbie

                Hello Nick,

                 

                I have it working with the a4j:outputPanel, only you have to put the rich:tooltip as a child of the a4j:outputPanel. When you make the rich:tooltip a child of the a4j:commandButton it does not work.

                 

                 

                So working is:

                 

                <aj4:outputPanel>

                     <a4j:commandButton .... />

                 

                     <rich:outputPanel>

                            hi

                      </rich:outputPanel>

                 

                </a4j:outputPanel>

                 

                I preferred just to make tooltip child of what ever component I would like and to have a tooltip, but I will use aj4:outputPanel.

                 

                 

                Thanks for your tip!!

                • 5. Re: Tooltip only works inside a panel?
                  Ilya Shaikovsky Master

                  not works

                  <h:commandButton  value="test">

                            <rich:tooltip>test</rich:tooltip>

                  </h:commandButton>

                   

                  works

                  <h:commandButton  value="test" id="but">

                            <rich:tooltip>test</rich:tooltip>

                  </h:commandButton>

                   

                  I believe that should be in RF documentation but not checked. the same will be for output text graphic image and maybe more ones.

                   

                  The problem is - components not always encodes it's id to the client if it's not set (auto-generated). And tooltip requires it to attach properly. So just not forget to set id to parent components which need tooltips and in most cases it will be ok.

                   

                  About input text. Looking to Input rendered code (TextRenderer)

                      @Override

                      public void encodeChildren(FacesContext context, UIComponent component)

                            throws IOException {

                   

                   

                          boolean renderChildren = WebConfiguration.getInstance()

                                  .isOptionEnabled(WebConfiguration.BooleanWebContextInitParameter.AllowTextChildren);

                         if (!renderChildren) {

                              return;

                          }

                   

                   

                  We see that JSF input not just not renders our tooltip (AllowTextChildren context parameter is false by default in JSF). So that's not tooltip problem also actually.

                  • 6. Tooltip only works inside a panel?
                    Tom Giberius Newbie

                    with a <h:commandButton ....>  it is working when id on the parent component is used.

                     

                    with a <a4j:commandButton ....> it is not working, also when id is used, (somehow I expect it should work).

                     

                    with the construction <a4j:outputPanel>

                                                            < just a component />

                                                            <rich:tooltip> Hello </rich:tooltip>

                                                   <a4j:outputPanel>

                    it is working for <h:inputText ....> and other components as I have see so far. So using <a4j:outputPanel> is for me the contstruction I will use.

                     

                    I think it is a good idea to put this more clearly in the documentation.

                     

                    Thanks for all the support!!

                    • 7. Tooltip only works inside a panel?
                      Ilya Shaikovsky Master

                      with a <a4j:commandButton ....> it is not working, also when id is used, (somehow I expect it should work).

                      worked for mee to when id is defined. need to check.

                       

                      B.t.w. wanted to say a few words about the workaround you using. It's ok and for that cases outputPanel was partially designd(except updates). But be aware about it layout attribute. It's ok to have default <span> rendering as far as you having just text inside. But it should be set to bolck to render <div> when block components placed inside.

                       

                      About docs - the only big concern - id's should be already in documentation.. but thanks maybe a good idea to recheck and rise an issue. And about text yup.. as not much guys knows about that settings for children encoding.

                      • 8. Re: Tooltip only works inside a panel?
                        Roberto Cordoba Newbie

                        Hi Ilya,

                         

                            I have seen in internet there was a bug for tooltip with h:graphicImage that was released in version RF.4.2.2.

                         

                        I´m using RF 4.2.3 and it´s not working for me. None of the both examples below work:

                         

                        1.

                        <div class="buscadorBarcosColumnaCorta" id="divIconoMasOpcionesBuscador">

                           <h:graphicImage value="/images/plusIcon.png" id="iconoMasOpciones" styleClass="iconoMedio">

                              <rich:tooltip value="Hi this is a tooltip"  />

                           </h:graphicImage>

                         

                        2.

                        <div class="buscadorBarcosColumnaCorta" id="divIconoMasOpcionesBuscador">

                                                                <h:graphicImage value="/images/plusIcon.png" id="iconoMasOpciones" styleClass="iconoMedio" />

                          <rich:tooltip value="Hi this is a tooltip" target="iconoMasOpciones" />

                        </div>

                         

                        Regards,

                        Roberto.

                        • 9. Re: Tooltip only works inside a panel?
                          Roberto Cordoba Newbie

                          Hi all,

                           

                             Workaround is not working for me neither. None of the next options works:

                          1.

                          <a4j:outputPanel>

                                   <h:graphicImage value="/images/plusIcon.png" id="iconoMasOpciones" styleClass="iconoMedio" />

                                   <rich:tooltip value="Hi this is a tooltip" />

                          </a4j:outputPanel>

                           

                          2.

                          <a4j:outputPanel>

                                                                            <h:graphicImage value="/images/plusIcon.png" id="iconoMasOpciones" styleClass="iconoMedio" />

                                                                            <rich:tooltip>"Hi this is a tooltip"</rich:tooltip>

                          </a4j:outputPanel>

                           

                          I have tested same combination by adding to web.xml

                          <context-param>

                             <param-name>com.sun.faces.allowTextChildren</param-name>

                             <param-value>true</param-value>

                          </context-param>

                           

                          and it still doesn´t work.

                           

                          In IE I can get next javascript error:

                          Webpage error details

                           

                           

                          User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MS-RTC LM 8; 889801903; Version/11.08050; managedpc)

                          Timestamp: Fri, 25 Jan 2013 13:50:06 UTC

                           

                          Message: Object expected

                          Line: 173377761

                          Char: 1

                          Code: 0

                          URI: http://localhost:8080/perrisyatchs/

                           

                          Please, help me. I need tooltips in my app.

                           

                          Thanks,

                          Roberto.