2 Replies Latest reply on May 13, 2010 9:35 AM by justinw

    <rich:toolTip mode="ajax"> in <rich:treeNode>, javascript error, toolTip disappears

      I'm having problems attempting to use <rich:toolTip> within a <rich:treeNode>. My test page layout is:

       

      <h:form id="testForm">
          <h:outputText id="testText" value="Text Out Of Tree Node" />
          <rich:toolTip id = "toolTip1" followMouse="true" mode = "ajax" for="testText" direction="top-right"  horizontalOffset="5"  verticalOffset="5" layout="block" >
             <f:facet name="defaultContent">
                  <f:verbatim>Loading...</f:verbatim>
             </f:facet>   
             <h:outputText value="Loaded"/>
          </rich:toolTip>
         

          <rich:tree id="testTree"
                 switchType="ajax" value="#{CustomerInventoryBean.testRoot}"
                      var="item" >
             

              <rich:treeNode id = "btnNode">
                   <h:outputText id="testTreeText" value="Text In Tree Node" />
                   <rich:toolTip id = "toolTip2" followMouse="true" mode = "ajax"  for="testTreeText" direction="top-right"  horizontalOffset="5"  verticalOffset="5" layout="block" >
                      <f:facet name="defaultContent">
                           <f:verbatim>Loading...</f:verbatim>
                      </f:facet>   
                      <h:outputText value="Loaded"/>
                   </rich:toolTip>
              </rich:treeNode>


          </rich:tree>
      </h:form>

       

      CustomerInventoryBean.getTestRoot() returns a TreeNodeImpl<String> with one TreeNodeImpl<String> child.

       

      When I mouseover the first outputText (testText) the tooltip behaves as I would expect -- it appears first with the defaultContent facet displayed ('Loading...') and then once the ajax call returns the tooltip changes to show the tooltip content ('Loaded').

       

      However, when I mouseover the outputText in the tree (testTreeText), it displays the tooltip with the defaultContent facet correctly, but when the ajax call returns the tooltip disappears entirely and I log a javascript error:

       

      Error: this.toolTip is null
      Source File: http://localhost:8080/portal/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/tooltip.js.jsf
      Line: 60

       

       

      If I remove  ' mode = "ajax" '  from the toolTip tag the tooltip works as expected by displaying the tooltip ('Loaded') on both outputTexts. Unfortunately, this is not a feasible solution for the functionality I need.

       

      I have tried several permutations of how to place the toolTip tag within the treeNode without any luck in avoiding this error. Am I missing something?