?
Solved

rich:tooltip on rich:tree ?

Posted on 2009-06-30
6
Medium Priority
?
906 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 
LVL 1

Author Comment

by:Nargzul
ID: 24845109
up!
0
 
LVL 3

Accepted Solution

by:
serrutom earned 750 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

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

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

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

765 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