Link to home
Start Free TrialLog in
Avatar of Nargzul
Nargzul

asked on

rich:tooltip on rich:tree ?

Is there a way to display some tooltip into each element of the tree, displaying by exemple the "description" field of each item?
Avatar of serrutom
serrutom
Flag of Belgium image

You can add a tooltip to the label of the tree.

If you want a tooltip on the icon you can use javascript (onmouseover, onmouseout) to show and hide a popup box.
<rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
   <rich:treeNode type="artist" iconLeaf="/images/tree/singer.gif" icon="/images/tree/singer.gif">
      <h:outputText value="#{item.name}" title="Tooltip" />
   </rich:treeNode>
   <rich:treeNode type="album" iconLeaf="/images/tree/disc.gif" icon="/images/tree/disc.gif">
      <h:outputText value="#{item.title}" title="Tooltip" />
   </rich:treeNode>
   <rich:treeNode type="song" iconLeaf="/images/tree/song.gif" icon="/images/tree/song.gif">
      <h:outputText value="#{item.title}" title="Tooltip" />
   </rich:treeNode>
</rich:tree>

Open in new window

Avatar of Nargzul
Nargzul

ASKER

But the problem is the Tree is dynamic and recursive.

So how can I specify this?

I can put a outputText in the recursive tree adaptor???

<rich:tree id="tree" switchType="ajax" ajaxSubmitSelection="true"  value="#{AddDeal.deal.idRequestedService}">
  <rich:recursiveTreeNodesAdaptor roots="#{AddDeal.rootService}" var="item" nodes="#{item.serviceCollection}" />
</rich:tree>

Open in new window

Avatar of Nargzul

ASKER

I've try this but it doesn't work:
<rich:tree id="tree" switchType="ajax" ajaxSubmitSelection="true"  value="#{AddDeal.deal.idRequestedService}">
  <rich:recursiveTreeNodesAdaptor roots="#{AddDeal.rootService}" var="item" nodes="#{item.serviceCollection}" >
    <h:outputText value="#{item.name}" title="#{item.description}"/>
  </rich:recursiveTreeNodesAdaptor>
</rich:tree>

Open in new window

Avatar of Nargzul

ASKER

up!
ASKER CERTIFIED SOLUTION
Avatar of serrutom
serrutom
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nargzul

ASKER

To long to implement.