Solved

rich:tooltip on rich:tree ?

Posted on 2009-06-30
6
891 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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
difference of if loops 23 62
java stored proc example 9 44
tomcat administrtor 12 59
Delphi Firemonkey: if the Sms contain special characters it won't send it 3 43
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

839 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