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

Similar Messages

  • How to select tree node with enter key instead of mouse click

    hia i have tree in forms 10g i can get node value when i click mouse on node but i want same with enter key which is not working any idea.
    thanx

    I'm afraid you have hit Bug 4509399
    If you have metalink access you should check Note:331369.1
    This bug has been around for the 10g R2 10.1.2.0.2 base release, which was propagated from Installing Patch 9.0.4.2 or from 10g R1 base release. You need to apply the latest patch or a one-off fix Patch 4509399
    Tony

  • How to create a node with attributes at runtime in webdynpro for ABAP?

    Hi Experts,
             How to create a node with attributes at runtime in webdynpro for ABAP? What classes or interfaces I should use? Please provide some sample code.
    I have checked IF_WD_CONTEXT_NODE_INFO and there is ADD_NEW_CHILD_NODE method. But this is not creating any node. I this this creates only a "node info" object.
    I even check IF_WD_CONTEXT_NODE but i could not find any method that creates a node with attribute.
    Please help!
    Thanks
    Gopal

    Hi
       I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
    Note
    The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
    The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
    Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
    Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
    Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
    My code is like the following:
    TYPES: BEGIN OF t_type,
                CARRID TYPE sflight-carrid,
                CONNID TYPE sflight-connid,
             END OF t_type.
      Data:  i_struc type table of t_type,
      dyn_node   type ref to if_wd_context_node,
      rootnode_info   type ref to if_wd_context_node_info,
      i_node_att type wdr_context_attr_info_map,
      wa_node_att type line of wdr_context_attr_info_map.
          wa_node_att-name = 'CARRID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
          insert wa_node_att into table i_node_att.
          wa_node_att-name = 'CONNID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
          insert wa_node_att into table i_node_att.
    clear i_struc. refresh i_struc.
      select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    rootnode_info = wd_context->get_node_info( ).
    rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
                                       attributes = i_node_att
                                       is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
    dyn_node->bind_table( i_struc ).
    l_ref_interfacecontroller->set_data( dyn_node ).
    I am trying to create a new node. That is
    CONTEXT
    - DYNFLIGHT
    CARRID
    CONNID
    As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
    Also I cannot define the structure in the ABAP dictionary because it changes based on condition
    Message was edited by: gopalkrishna baliga

  • WD ABAP: Recursion Nodes that Repeat Tree Nodes with Embedded Tables ???

    At Rich H's suggestion, I'm posting this here as well as in the blogs.
    Suppose you've got a tree context with a node that has a table embedded under it. (For example, the TREE_WITH_TABLE view of WDR_TEST_EVNT has this kind of context substructure.) Call this node "NODE_WITH_TABLE."
    You now define a recursion node underneath "NODE_WITH_TABLE" and specify "NODE_WITH_TABLE" as the repeated node for this recursion node. Call this recurion node "RECURSION_NODE".
    Lo and behold - the table fills properly when you're on any instance of "NODE_WITH_TABLE", but not when you're on an instance of "RECURSION_NODE".
    I'm hoping that:
    a) I'm doing something wrong;
    OR
    b) There's an easy work-around/alternative I'm not seeing
    OR
    c) SAP will give recursion nodes enough memory to carry any table(s) embedded in the nodes they're repeating.
    'Cause I sure don't want to have to define "n" levels of tree-nodes that have different copies of the same table(s) embedded in them.
    Message was edited by: Armin Reichert

    /people/david.halitsky/blog/2006/08/16/recursion-nodes-that-repeat-tree-nodes-with-embedded-tables-in-wd-abap-not
    Maybe you might want to back out your weblog as it is not really a place to ask these types of questions.  Think of it this way,  if you are allowed to do this type of weblog,  what is stopping any other weblogger.  Hence the weblogs would just be another forum, which I don't think anyone wants. 
    Regards,
    Rich Heilman

  • How to get the itunes with those 3 colored buttons on top left corner ????ner ???

    Please help [humble request] ----
    I have 3 problems can u please help me out --
    1) How to get the itunes with the 3 colored buttons (i'm new to apple ,just 8 days so i dont know much stuff) on top left corner ,i've downloaded thrice from apple's site directly i everytime got the same sort of itunes with 'File' ,'Edit' ,'View' ,'Controls' ,'Store' ,'Adanced' ,'Help' on the top ,and also whenever i open the itunes store (in this itunes) only the app store opens ,now music albums ,movies ,tv shows nothing !!
    2) I dont know how to import video files from the computer to itunes
    3)i bought an app [fifa 11] ,n downloaded another 1 [contract killer] {ive deleted them and downloaded them thrice ,and they dont sync to my itouch it shows error (0xE800004C)
    Please please please help me im getting worried and frustrated
    please help me out with this

    but illaass
    i asked 2 of my frnds both of them have windows n not mac ,both of them are sayin dat they have the coloured buttons one , and i asked them dat how to access the itunes music store they said that when they kliked d itunes store option in the left side a screen appears where 6 -7 categories are there which are music store ,app store ,podcasts ,movies ,tv shows etc . bt when i open it it only shows d app store ,and on the bar only 4 options are ther the home icon , app store , podcasts and itunes u ,and when i klik movies ,tv shows on the left side ,there is an option "browse for movies in the itunes store" i klik it and only the app store opens and nothing else .
    and thanks now i know how to import videos
    and sigma 1337 ,
    ive downloaded the apps 4 -5 times now , still d same error mssg it comes like dis :-
    " Some of the apps in your iTunes library were not installed on the ipod "Shomik's ipod" because one or more errors occurred "
    please help me  im gettin frustrated

  • How to hide a node with no children in ADF Tree after Search

    Hi,
    I have a tree component with Search in my screen.
    I followed http://www.jobinesh.com/2010/01/search-by-child-attributes-on-tree.html to implement search.
    Search is performing on the childnodes, once the search is done I am expanding all the nodes and displaying only the filtered records.
    my code to expand all the nodes :
    public void expandAllTreeNodes() {
    UIXTree tree = getGroupTree();
    RowKeySet disclosedRowKeys = new RowKeySetTreeImpl(true);
    CollectionModel model = (CollectionModel)tree.getValue();
    JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)model.getWrappedData();
    JUCtrlHierNodeBinding nodeBinding = treeBinding.getRootNodeBinding();
    List<JUCtrlHierNodeBinding> childNodes = nodeBinding.getChildren();
    if (childNodes != null) {
    for (JUCtrlHierNodeBinding _node : childNodes) {
    disclosedRowKeys.add(_node.getKeyPath());
    disclosedRowKeys.remove(_node.getKeyPath());
    tree.setDisclosedRowKeys(disclosedRowKeys);
    Now I want to hide the nodes which does not have children after search.
    how can I hide the node if _node.getChildren() is null.
    Could any one provide some inputs on this.
    Thanks,
    Swathi

    AE Basics
    Keyframe the mask path.

  • 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.

  • 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.

  • Highlight tree node

    A quick problem for you experts. I am trying to get a node in a JTree to be highlighted with the 'blue' background as if someone has selected it with a mouse click. Unfortunately, setSelectionPath(TreePath path) is not doing this for me.
    I am using a custom TreeCellRenderer which extends the DefaultTreeCellRenderer. Would anyone know what exactly I need to do in my custom renderer to highlight a node?
    thanks.

    Good time for asking your question 'cause I just had a similar problem and finally figured out how to fix it.
    First, the DefaultTreeCellRenderer has a few variables that determine the text color, background color, selection text color, selection background color, etc. The ones you want to modify to make selection work would be: backgroundSelectionColor and maybe textSelectionColor.
    Another variable is protected boolean selected, if it's true then your node should be highlighted.
    If you look at the DefaultTreeCellRenderer's Constructor it is:
      public DefaultTreeCellRenderer() {
        setHorizontalAlignment(JLabel.LEFT);
        setLeafIcon(UIManager.getIcon("Tree.leafIcon"));
        setClosedIcon(UIManager.getIcon("Tree.closedIcon"));
        setOpenIcon(UIManager.getIcon("Tree.openIcon"));
        setTextSelectionColor(UIManager.getColor("Tree.selectionForeground"));
        setTextNonSelectionColor(UIManager.getColor("Tree.textForeground"));
        setBackgroundSelectionColor(UIManager.getColor("Tree.selectionBackground"));
        setBackgroundNonSelectionColor(UIManager.getColor("Tree.textBackground"));
        setBorderSelectionColor(UIManager.getColor("Tree.selectionBorderColor"));
        Object value = UIManager.get("Tree.drawsFocusBorderAroundIcon");
        drawsFocusBorderAroundIcon = (value != null && ((Boolean)value).
                              booleanValue());
        }All it's doing here is gathering the colors specified by your UIManager and storing them in as textSelectionColor, backgroundSelectionColor, etc.
    If you want to use the colors define in your UIManager you don't need to call anything, however if you want to set a certain backgroundSelectionColor like blue, you would call setBackgroundSelectionColor(Color.BLUE) in your constructor (instead of what is up there)...All the constructor does is just store these colors in the DefaultTreeCellRenderer's variables, it does not select or color anything just yet.
    Basically if you want something to be shown as selected you have to look at this function: getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) In my code I made a custom TreeUI which extends BasicTreeUI and in it I override the    protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) function of BasicTreeUI and if the TreePath that is being passed to it is the one I want highlighted I see that the real highlighting occurs when it calls DefaultTreeCellRenderer.getTreeCellRendererComponent()... basically you pass in your JTree, then the node path.getLastPathComponent() that you are currently wanting to paint, then sel (which is set to true if you want that node selected), then expanded (if you want it expanded), leaf (if you want it drawn as a leaf), row (the row that the node resides), and hasFocus (if you've allowed a focus Listener). This function returns to you a Component which you paint using paintComponent - the code for paintRow() is all in BasicTreeUI.java.
    Even though I did all that, all you need to do, if you are calling your custom TreeCellRenderer from you MouseHandler or Listener is setForeground(), the DefaultTreeCellRenderer renders a selected node by calling setForeground(getTextSelectionColor()) and it renders an unselected node by calling setForeground(getTextNonSelectionColor()), it also sets selection (boolean) value to true if your node is supposed to be selected - those things are all done when getTreeCellRendererComponent is called. When paint() is called the node is actually drawn as being selected.
    so in short:
    setTextSelectionColor(Color.WHITE);
    setBackgroundSelectionColor(Color.BLUE);
    setForeground(getTextSelectionColor());  //from getTreeCellRendererComponent();
    selection = true;
    paint(Graphics g);Those are the functions you should look at and hopefully you can get your node highlighted.

  • How to highlight tree item ?

    Hello everybody !
    I have a question : how to highlight a tree item on a condition ? (please see the attached vi and the pictures for a clearer explanation of the problem)
    I am using LabView 2014.
    Thank you very much !
    Solved!
    Go to Solution.
    Attachments:
    Highlight_tree_item.vi ‏13 KB

    Have patience.  You only aske the question about 40 minutes earlier.
    You highlight rows like you want by writing values to the tree control.  Don't mess with cell background color.
    Are you trying to highlight multiple items?  If so, then right click on the control and allow it to select 0 or more items.  As soon as you select a mode with the possibility of more than one item, the tree values become an array of strings rather than just a string.  You will need to build an array of strings that you will write to the control's local variable to highlight the multiple items.

  • How to store  tree nodes in data base

    i am creating a tree with create node and delete node dynamically
    how can i store the tree nodes in the data base and how can i retrive them from data base to tree and tree table

    Thank s for replay
    I am tring to the tree nodes and Dynamically creating and removing the nodes from the tree that tree structure have to store in the data base and after wards retrive the tree structure from the database and display as the tree

  • 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 create a node with attribute?

    hi,
    does anyone can help with creating an XML node with only attributes but no value?
    e.g.
    <root>
       <category node_id='ND1'>
          <value id='1'>some value in here</value>
          *<extra_node desc="this is the new node i want to create"/>*
       </category>
       <category node_id='ND2'>
          <value id='1'>some value in here</value>
       </category>
    </root>in the example, what i want to do is to get the category using XPath, and insert one attribute node into it.
    anyone can help? sincerely appreciated!

    No, the question was not about attributes with no value, it was about elements with no value.
    Now I know that the "value" of an element is a meaningless term in XML, but the OP's example shows that the question was how to produce an empty element. Even though the text describes the operation as "insert one attribute node", which doesn't agree with the example.
    It's easy to create an empty element using DOM, but we have no idea whether the OP is talking about DOM programming or what.

  • How to highlight word(s) with different colors?

    I have Mail, Version 3.2 (919/919.2)
    Re: color
    I see that it is possible to change the color of text and to change the color of the entire field background, but I want to be able to HIGHLIGHT certain words with light colors like yellow, not just change the color of the text.
    Is it possible to HIGHLIGHT word(s) in Mail?
    If so, how? I looked at all the options and read the Help etc.
    Lorna in Southern California
    web.mac.com/lorna6

    OK, outgoing messages. For some reason I thought you wanted to flag stuff in received mail. Mail Tags is certainly not what you want.
    Can you recall what keys or key combinations you used in Tiger? I presume it did more than simply change text to bold?
    If you have selected Rich Text in Mail's Preferences/Composing you can colour the text. Use Format/Show Colors to bring up the floating colour window (if you need it a alot have it up all the time) and when you select some text and click on one of the colours it will be changed to that colour - but not highlighted.
    AK

  • How to highlight search term in a different color in search results?

    Hi
                  How can I highlight search term in a different color in the search results. Currently it is black, I would like to change it to green.
    Thanks in advance
    Regards
    Vidya

    Dear Bhanu,
    It might be possibe but i am not fully sure about it.
    try with different combination and check it.
    I need to check whether it is feasible or not.
    Best Regards,
    Arun Jaiswal

Maybe you are looking for