Solved

rich:tooltip on rich:tree ?

Posted on 2009-06-30
6
884 Views
Last Modified: 2013-11-24
Is there a way to display some tooltip into each element of the tree, displaying by exemple the "description" field of each item?
0
Comment
Question by:Nargzul
  • 4
  • 2
6 Comments
 
LVL 3

Expert Comment

by:serrutom
ID: 24753115
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

0
 
LVL 1

Author Comment

by:Nargzul
ID: 24753481
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

0
 
LVL 1

Author Comment

by:Nargzul
ID: 24753852
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

0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:Nargzul
ID: 24845109
up!
0
 
LVL 3

Accepted Solution

by:
serrutom earned 250 total points
ID: 24846957
I never used the recursiveTreeNodeAdaptor, so won't be able to help you. In the documentation, there is no title parameter for this component.

What you can do, write your own implementation on the recursiveTreeNodeAdaptor, and add an extra paramter 'title' to it.
You probably will need to re-write your tag, component and renderer.
0
 
LVL 1

Author Closing Comment

by:Nargzul
ID: 31598546
To long to implement.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now