How to highlight a node in a tree?

i used setSelectionPath() . But it is highlighting the node's icon only(i.e by changing the color to lavender). I'm getting higlighted the node with setSelectionInterval(ind,ind) only. I want that higlighlighting to be with setselectionPath() . How to do?
Appreciating any help
Thanks.

When I do a setSelectionPath the node-text is highlighted, not the icon. Anyways, do a custom treecellrenderer like this:
public Component getTreeCellRendererComponent(.......) {
if(selected == true) setBackground(somecolor)
else setBackground (defaultcolor)
if that describtion isnt sufficient try search the forum.

Similar Messages

  • Selecting/highlighting a node in Flex Tree using HierarchicalCollectionView as DataProvider

    Hi,
    I am using GroupingCollection2 as the dataprovider for HierarchicalCollectionView. The GroupingCollection2 takes its data from an ArrayCollection. And finally I have a Tree whose dataprovider is the HierarchicalCollectionView . I want to acheive 2 things:
    1) I want to programatically select/highlight a node in this tree. Using expandItem and passing the Object from the arraycollection is not working.
    2) Refresh the tree if there is a change in the arrayCollection.
    For the second task, I have a Java Layer that gives me the ArrayCollection  (dp for GroupingCollection2) when I fire a CairngormEvent. But the problem is that every node in the tree is duplicated. I can clearly see that say there are 8 items in the array collection but still the tree shows 16 items ( Each item duplicated as the node in the tree.)
    I have been trying to figure this out for many days now without any luck. Any sort of suggestion would be appreciated.
    Thank u in advance.

    I got the refreshing of the tree part by myself. One needs to call the refresh method on the GroupingCollection2 and HierarchicalCollectionView objects when the arraycollection has just arrived from the database.
    But I still havent been able to figure out how to highlight or open a tree node programatically. I am repeating that using (calling / setting) tree.expandItem() and tree.openItems is not helping me. Plz somebody help.

  • How to not display nodes in a tree if Oracle roles are NOT used?

    How to not display nodes in a tree if Oracle roles are NOT used?
    We don't use Oracle DB roles to grant users access to Forms from the menu. We use a template and role system of our own. Basically a few tables with templates and roles.
    We want to convert our normal Forms menu to a tree menu and one of our key requirements is that when the tree is populated ONLY nodes with programs (i.e. forms) he has been granted to execute is shown.
    Since we don't use Oracle Roles how to do this in a tree?
    I created a function to show/hide LEAF nodes, BUT problem is that there are sub-menu nodes showing even if the leaf-nodes under it has not being displayed. My function has suppressed it.
    My tree query is like this:
    SELECT
         t.status, LEVEL, t.label, t.icon, t.node VALUE
    FROM
         tma_tree_menu t
    WHERE
    tma_authenticate_sys_chk_role(USER, t.node) = 1
    CONNECT BY
         PRIOR t.node = t.master
    START WITH
         t.MASTER IS NULL
    ORDER SIBLINGS BY
    t.position
    The tma_authenticate_sys_chk_role will return 1 only if the user has access to the form under that node.
    I tried the FTree functions in Forms but even that has nothing.
    Any help would be greatly appreciated.
    Edited by: Channa on Mar 17, 2010 6:49 AM

    Would you share the source code? I guess what I need is how exactly you retreive the user credentials from the DB table and set that boolean variable.
    and then how to condition it in UIX?

  • Hierachical tree - Highlight particular node's in Tree

    Is there any way to bold or change the colour of particular nodes in a tree?
    We know and use the node icon to distinguish between them but ideally would want to bold some to highlight areas
    I can not see how to do this looking at the documentation but may be wrong.
    Thanks

    Thanks thats what i thought but hoped i was wrong.

  • How to next consecutive node in binary tree and insert in sql server

    i need to find next node in this tree and insert in sql server ...
    dilip kumar

    It depends you data structure. How do you store this tree structure in the database? What's the database design? BTW, you can see this article which include a related sample :
    Custom Sort in Acyclic Digraph
    T-SQL e-book by TechNet Wiki Community
    My Blog
    My Articles

  • JTree - How to Expand all Nodes in the Tree

    I have a tree that has one primary node, two sub-nodes, and multiple sub-sub-nodes under those. I want to expand (show) all these nodes in the tree when the tree first loads. I tried expandRow() but that only seems to expand one row at a time by entering a single integer for the row. Is there any way to expand all rows/nodes when loading the tree?

    see
    http://forum.java.sun.com/thread.jsp?forum=57&thread=148793

  • How to highlight JTree node without selecting it

    Hello,
    I want to highlight a Tree Node without selecting it.
    Anybody having ideas as to how i can do it.
    thanks in advance.
    Reg,
    sai

    for what it's worth for anyone with the same problem, the problem was that the node was being regenerated as a different object so each time it went through the object wasn't the same and therefore had a new expanded value as default of false.

  • How to highlight a node in a JTree???

    I am trying to highlight (actually set the Font to Bold) one node of a JTree when an TreeSelectionEvent occurs (valueChanged method). The node to be highlighted can be different than the one selected.
    Thanks for your help.
    JavaSan

    To control the appearance of tree nodes, you need to write a TreeCellRenderer. Check Sun's tutorial on how to use trees (there's a link to it in the API documentation for JTree). The signature of the method you need to implement is this:
    public Component getTreeCellRendererComponent(
        JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)so as you can see, you can vary the appearance of the node based on any of the parameters of that method.

  • How to eliminate empty node space from tree when rendered property is false

    Hi
    I have created a menu Tree for my ADF BC application while working in JDev 10.1.3.3.
    I have tried two methods, first is by creating a menu model as discussed in example in ADF Developers Guide Book Section 19.2.1. Second by creating two view objects and creating the menu tree from my database table.
    Depending on the logged in user I want to decide whether to show or not to show a menu tree option to the user. For this purpose I have implemented a function in a managed bean that calls a pl/sql stored procedure to decide if the user has access to a certain component. In first case I have set the rendered property of the menu item to #{menuTree.shown}, where shown is an attribute in the menu model whose value is properly set using java functions that call pl/sql function in turn. In second method, I have also tried to set the rendered property and calling a function that returns true or false based on if the user has access to the menu option.
    Problem
    When rendered property is returned as false, although the menu option is not displayed but an empty space is displayed in my tree and remaining nodes and/or menu options are displayed with an ugly gap.
    How I can remove this unwanted gap, is there a way?
    Regards,
    Amir
    1st option:
    My menu tree:
    <af:menuTree var="menuTree" value="#{menuModel.model}">
    <f:facet name="nodeStamp">
    <af:commandMenuItem text="#{menuTree.label}"
    action="#{menuTree.getOutcome}"
    _rendered="#{menuTree.shown}_"/>
    </f:facet>
    </af:menuTree>
    2nd option:
    <af:tree value="#{bindings.MainMenuView.treeModel}" var="node">
    <f:facet name="nodeStamp">
    <af:switcher facetName="#{node.hierType.name}">
    <f:facet name="MainMenuViewNode">
    <af:outputText value="#{node.Name}" _rendered="#{userInfo.mainNodeOk}"_ />
    </f:facet>
    <f:facet name="SubMenuViewNode">
    <af:commandLink text="#{node.Name}" _rendered="#{userInfo.mainNodeOk}_">
    <af:setActionListener from="#{node.destinationUrl}"
    to="#{menuTree.getOutcome}"/>
    </af:commandLink>
    </f:facet>
    </af:switcher>
    Edited by: Amir Khan on Jan 12, 2009 8:54 PM

    Hi,
    if this reproduces in JDeveloper 10.1.3.4 then this sounds like a bug that you should file
    Frank

  • How to disable a node in ADF Tree Table?

    Hi,
    I'm using JDeveloper version - 11.1.1.7
    I have a requirement to disable the nodes in Tree table based on status of the node. How can I achieve this?
    Any inputs would be helpful.
    Thanks
    Ravi

    Hi,
    you cannot disable nodes in the sense that they cannot be expanded or selected. What you can do though is to ignore node selections in a custom selection handler or to render the node different (e.g. using an output text component instead of a command link or image etc.). What is your functional requirement for what disabled nodes should not do
    Frank

  • How to highlight/indicate particular tree Node in Tree UI element

    Hi All
    Can anybody let us know how to highlight/indicate specific node in a tree struture.
    currently i am able to display the tree struture with all the nodes & elements but it is always tasking firstnode as highlighted one or indicated one.
    if i want to highlight specific node in a tree struture...what was the procedure or any sample code then it would be great help to us.
    Thanks
    Trisha rani

    Hi Krishna
    Thanks for your reply
    I displayed the tree structure and i want to highlight specific parent node/child element , what was the sample code??
    for example my tree was displayed in the below struture and at the runtime specific child node i wanted to be highlighted i want to make selectable particular nodeType......
    Can you pls send sample codee code??
    my requirement
    A
    A1
       A2
       A3
    B
    B1      
       B2
       B3
       B4
       B5     
    now i want to make selectable or highlighted B4,B5 etc  or A2,A3 at runtime.
    The other guy who replied for this thread it is working for Parent nodes to make highlighted  like it is working for parent nodes which is have child nodes. i am able to hightlight at runtime for Nodes A,B etc .
    Now i want to highlight or make selected one for B4,A3 etc, pls provide sample code??
    it  would be great help to us
    Thanks
    Trisha Rani

  • How to edit the node value of a tree in webdynpro java

    Hi ALL
    I have Tree UI element where i got displayed all the nodes by calling the BAPI
    Now my requirement is when i put the cursor at any node in the Tree struture then on click of insert button i need to insert the new node with the text  , the user has to be option to give new text for the new node dynamically  , so while adding the new node in a tree the tree has to choose the text for new node , like how to edit the node of a tree to add new text.
    If any one can send the sample code on the same then it would be great help to me.
    Similar requirement like in table UI Like however we are adding the new row in a table when we click on the insert button then cursor will go to that new row in a table where user can enter his details in the table.. now i am looking for the same requirement in a Tree UI element.
    is it possible the same requirement in tree UI element in webdynpro for Java??
    Thanks
    kallki reddy

    Hi kallki reddy
    In general I think this is not possible in the form you'd like. It seems the Tree control is read-only thing always. It cannot provide editing capabilities.
    Table is different thing. You can select within many different cell editors including Input Fields.
    I guess that you scenario could be implemented not with Tree control, but with Table with Master Column. The master column allows to bring up a hierarchy into a plain table. So it's just a tree inside a table.
    Here you can find further details: [TreeByNestingTableColumn API|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/92/12a74046033913e10000000a155106/content.htm]
    BR, Siarhei

  • Tree Bean - how to select a node?

    Can someone help how to select a node of the Tree based on the key programmatically?

    Hi there..
    I use a code like this..
    [Bindable] public var selectedNode:XML;
    [Bindable] public var mynewVar:String;
    public function treeChanged(event:ListEvent) : void   {  
    selectedNode = Tree(event.target).selectedItem as XML;
    mynewVar = selectedNode.@nameofNode;
    Cheers!

  • How to disable "Expand All" and "Collapse All" when no node in a tree

    I have a <af:tree> inside <af:panelCollection>.
    All items under viewMenu like "Expand", "Expand All Below", "Collapse All Below", "Expand All" , "Collapse All", "Scroll to First" and "Scroll to Last" are implemented by default.
    When there is no node in a tree, "Expand", "Expand All Below", and "Collapse All Below" are grey out.
    However, "Expand All" , "Collapse All", "Scroll to First" and "Scroll to Last" are still enabled to be clicked.
    Is there any way we can diable them when no node?

    When I highlight last node in the tree and all nodes are collapsed, I see "Expand All Below" enabled but "Collapse All Below" disabled. Which is expected. Expand All Below will expand all the child nodes under a node.
    QA filed a bug said that "Expand All Below" should be disabled since no node below it. However, I don't find any place to control them. Can you confirm this? Or you know some way to do this?It it not a bug then. You don't have to control it and framework takes care of enabling and disabling it accordingly.
    If you need to expand all the nodes programatically, check this out.
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/78-man-expanding-trees-treetables-354775.pdf
    -Arun

  • How to highlight Tree node with a diff color

    I have created tree node and want to highlight Selected node with a different background color. Any Ideas how can we achieve that? -R

    It's an item on page 4 of the application that the blog example is taken from. The tree query:
    SELECT EMPLOYEE_ID AS ID
         , MANAGER_ID  AS PID
         , CASE
             WHEN EMPLOYEE_ID = :P4_EMPLOYEE_ID THEN
                 '<span style="color:white;background-color:blue;">'||
                 LAST_NAME||
                 '</span>'
             ELSE
                 LAST_NAME
           END AS NAME
         , 'f?p=&APP_ID.:4:'||:SESSION||'::NO::P4_EMPLOYEE_ID:'||EMPLOYEE_ID AS LINK
         , NULL        AS A1
         , NULL        AS A2
      FROM #OWNER#.EMPLOYEESgenerates leaf nodes that link to page 4, setting the value of P4_EMPLOYEE_ID. When page 4 is rendered, P4_EMPLOYEE_ID contains the ID of the clicked node, the page displays details of the employee with this ID, and the case expression in the tree query causes the corresponding display value to be highlighted.
    See the sections Managing Session State Values and Using f?p Syntax to Link Pages in the documentation to understand how to set session state values using URLs.
    http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/concept.htm

Maybe you are looking for

  • XML Parsing - problem with a value of an element if starting with space

    Hi Experts, I need your valuable guidence to get out of a problem in parsing an XML file. An XML file is read into xstring variable and it is processed to be split into the corresponding itab. Please find the code below types: begin of ty-itab,      

  • Error While releasing  to accounts

    Hi, When I'm trying to release billing document to accounts.  I'm getting error " Jurisdiction code is not defined for calculation procedure TTXJ"  Regards Nagendra

  • Urgent: Error in Inbound Proxy in SCM system

    Hi All Please give your inputs to solve following problem I am facing. I am working on XI first time so please help me out to solve the following problem. Please let me know if you need any more info. Thanks a lot for your help guys. I am sending ORD

  • View GR report based on posting date

    Hi, Is there any report to view GR on PO by enter posting date? Because i check ME2M,only can enter delivery date. Thank you.

  • Pass item from a page to another

    Hello, I am trying to pass the item P3_QUESTION to the item P8_QUESTION from a page to another. I have used v('P3_QUESTION') in the source field from P8_QUESTION item and it didn't work. Could you help me to solve this problem? Thank you, Ruxandra