Highlight selected node in tree?

UI Components for JSF
Post Reply
ninjapiehole
Posts: 12
Joined: 01 Dec 2009, 19:24

03 Feb 2010, 20:27

I am trying to use the tree component but I can't figure out how to highlight the node once it's selected. This tree dynamically updates other components but there is no indication of which node was selected.

Code: Select all

<p:tree id="reportTree" value="#{reportTree.model}" dynamic="true" var="doc"
                        nodeSelectListener="#{reportTree.onNodeSelect}" cache="false"
                        update="instanceHeader,instanceGroup">
  <p:treeNode>
    <h:outputText value="#{doc}"/>
  </p:treeNode>                    
</p:tree>
Also, I tried to put a commandlink in the treenode and it cause the whole tree to dissappear. Are only text supported in nodes?
Thanks!
JSF2 (Mojarra) / Primefaces 2

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

04 Feb 2010, 14:46

Do you mean highlight like this example;

http://developer.yahoo.com/yui/examples ... clean.html

josel
Posts: 16
Joined: 15 Dec 2009, 20:51
Location: Brazil

05 Feb 2010, 14:03

Hi Catagay

Primefaces-SNAPSHOT
JSF 2.0.1
Tomcat

I would like to do the highlight of the treenode clicked as you show in the example. How can this be done?

Thanks
JoseL
---------------------------
PrimeFaces 2.0.0
JSF 2.0.2
Tomcat 6

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

05 Feb 2010, 16:06

Tree was supposed to highlight it by default, I need to look into this. I think I have a clue. :)

mbeedub
Posts: 93
Joined: 28 Jan 2010, 23:54

08 Feb 2010, 23:03

Would also like to be able to do this.

Cheers
JBoss EAP 6.4.0 | Mojarra 2.1.28 | PrimeFaces 6.2.3

tcasasent
Posts: 21
Joined: 06 Jan 2010, 21:39

25 Feb 2010, 20:38

Any idea how you or when you intend to implement this? I have something like this working if I redraw the tree, but ran into a problem I'll post in a minute on implementing my solution without having to redraw the tree. (Redrawing is bad because of the blink and if the tree is scrolling, the selected node may not be visible anymore.)

I have notice that it "highlights" in blue a node when you open and close the node, which is not the same as being "selected".

I tried using the checkboxes, but that doesn't support single selection mode (without a redraw).

-Tod


tcasasent
Posts: 21
Joined: 06 Jan 2010, 21:39

01 Mar 2010, 15:03

Thanks!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests