5 Replies Latest reply on Dec 8, 2009 9:12 AM by tkalactomo

    Tooltip and ajax status component

      Can you please tell me how to make tooltip to show on a4j:status onstart event.

      More detailed I would like to put in a tooltip something like "Loading..." label
      and tooltip which has a folow mouse attrubute set to true so the user always see that label when ajax request is processing.

       <a:status>
       <f:facet name="start">
       <h:graphicImage value="/pics/icons/mozilla_blu.gif" />
       <r:componentControl name="controlMe" event="onstart" attachTo="ajaxStatus" for="ccToltipID" operation="show" />
       </f:facet>
       </a:status>
      
      <r:toolTip attached="false" followMouse="true" id="ccToltipID" value="#{msg['loading']}.." />
      


      Thi isn't working can someone help please?



        • 1. Re: Tooltip and ajax status component
          ilya_shaikovsky

          try to call it using js api on status onstart and hide on onclick.

          • 2. Re: Tooltip and ajax status component

             

            "ilya_shaikovsky" wrote:
            try to call it using js api on status onstart and hide on onclick.


            In the richfaces developers guide says:
            <rich:panel id="panelId" onclick="#{rich:component("tooltipId")}.show(event);" />
            <a4j:form>
             <rich:toolTip id="tooltipId" attached="false" value="This is a tooltip."/>
            </a4j:form>
            


            And it says:

            Notes:
            To provide <rich:toolTip> component proper work in complex cases do the following:
            *specify "id's" for both <rich:toolTip> and component it is applied to;
            *define the <rich:toolTip> as last child, when nesting it into the component the <rich:toolTip> is applied to;
            *put the <rich:toolTip> into <a4j:form> when invoking it with JS API function.


            In my jsp page i have
            <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="r"%>
            declaration so i tried like this:

            ...onstart="#{r:component("tooltipId")}.show(event);}"...
            


            It doesn't work and I followed all important notes from richfaces developer guide.
            I use richfaces 3.3.0 version maybe that is a problem and a guide is for 3.3.2 version.

            Can you please post some code that could maybe help...


            • 3. Re: Tooltip and ajax status component

              When invoking tooltip from onclick event or some other event from components
              toltip invokes (shows) and works just fine:

               <r:panel onclick="#{r:component('ccToltipID')}.show(event);">
               </r:panel>
              
               <r:toolTip for="form" followMouse="true" id="ccToltipID"
               attached="false" value="#{msg['loading']}.." styleClass="crno" />
              
              <h:form id="forma">...
              


              but when invoking from onstart event of a4j:status comeponents
              browser shows:

              <a:status id="ajaxStatus"
               onstart="#{r:component('ccToltipID')}.show(event);"
              


              Greška: Permission denied to access property 'parentNode' from a non-chrome context
              Izvorna datoteka: http://localhost:8080/orkaRif/faces/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/tooltip.js
              Linija: 17
              
              in tooltip js:
              ...relTarg=relTarg.parentNode;}}
              


              Is that some kind of bug or what?

              • 4. Re: Tooltip and ajax status component
                ilya_shaikovsky

                yes... missed one point.. status do not passes any event to handlers - so tooltip can't be initialized.

                you could try to store event for example with mousemove event on document observing and then pass it to function. but not sure if this would be good workaround..

                • 5. Re: Tooltip and ajax status component

                   

                  "ilya_shaikovsky" wrote:
                  yes... missed one point.. status do not passes any event to handlers - so tooltip can't be initialized.

                  you could try to store event for example with mousemove event on document observing and then pass it to function. but not sure if this would be good workaround..


                  OK. Thank you for your time and help ilya_shaikovsky.
                  But as you said that is not a effect that we want.
                  Will find something else without tooltip.

                  Thanks again ;).