1 Reply Latest reply on Mar 26, 2012 5:47 AM by chris h.

    Problem with rich:tree and rich:tooltip

    chris h. Newbie

      We have a rich:tree and inside the tree we want to apply a tooltip for each tree node (Richfaces 4.2.Final).

      But unfortunately we get a tooltip for all nodes in the hierarchy.

       

      Someone has an idea?

       

      Here is the xhtml file:

       

      <rich:tree id="tree" var="node" 
         value="#{bakingTreeBean.rootNodes}" nodeType="#{node.type}"
         selectionType="ajax"
         selectionChangeListener="#{bakingTreeBean.selectionChanged()}"
         render="haha">
         <rich:treeNode id="tr_treeNode" type="#{node.type}">
      
            <a4j:outputPanel id="tr_a4joutputpanel">
                  <rich:dragIndicator id="tr_ind" acceptClass="accept"
                         rejectClass="reject" draggingClass="default">
                         <h:outputText value="#{node}" />
                  </rich:dragIndicator>
                  <rich:dragSource type="#{node.type}" dragValue="#{node}"
                         dragIndicator="tr_ind" />
                  <rich:dropTarget acceptedTypes="#{node.type}"
                         dropListener="#{treeBean.processDrop}" execute="@this"
                         dropValue="#{node}" render="@all">
                  </rich:dropTarget>
                  <h:outputText value="#{node}">
                  </h:outputText>
            </a4j:outputPanel>
            <rich:tooltip followMouse="false" mode="ajax" 
                  ajaxChildActivationEncodeBehavior="none" for="tr_treeNode"
                  styleClass="tooltip-custom-body" layout="block">
                  <span style="white-space: nowrap"> #{node} <br />
                  </span>
            </rich:tooltip>
         </rich:treeNode>
      </rich:tree>
      

      richtree.png

        • 1. Re: Problem with rich:tree and rich:tooltip
          chris h. Newbie

          I found the solution. We just have to move the rich:tooltip tag into the <a4j:outputPanel>

           

           

          <a4j:outputPanel id="tr_a4joutputpanel">

              <rich:dragIndicator id="tr_ind" acceptClass="accept"

                  rejectClass="reject" draggingClass="default">

                  <h:outputText value="#{node}" />

              </rich:dragIndicator>

              <rich:dragSource type="#{node.type}" dragValue="#{node}"

                  dragIndicator="tr_ind" />

              <rich:dropTarget acceptedTypes="#{node.type}"

                  dropListener="#{treeBean.processDrop}" execute="@this"

                  dropValue="#{node}" render="@all">

              </rich:dropTarget>

              <h:outputText value="#{node}">

              </h:outputText>

              <rich:tooltip followMouse="false" mode="ajax"

                  ajaxChildActivationEncodeBehavior="none"

                  styleClass="tooltip-custom-body" layout="block">

                  <span style="white-space: nowrap"> #{node} <br />

                  </span>

              </rich:tooltip>

          </a4j:outputPanel>

           

           

          I hope this will help someone... Kind regards