Highlight node in tree in apex 4

Hello!
The tree has nodes. Node name can include the number in brackets, for example "Messages (1)". Requires such nodes in the tree is highlighted in red, regardless of whether a node is selected or not. At the same time a tree node can be at different levels, not necessarily at the root or leaf.
I made javascript, but it does not work correctly, API tree is not very clear.
The script highlights only the first level and all children, and that is not true.
treeData = window [tree.attr ('id'). replace (/ ^ tree (\ d +)$/, 'l $ 1Data')] [0]. children;
for (var i = 0; i <treeData.length; i + +)
try {
if (/ \ S + \ (\ d + \) $ /. test (treeData . data.title))
{apex.jQuery ('li [id =' + treeData [i]. attributes.id + '] a'). css ('color', 'red'). css ('font-weight', 'bold'); }} catch (err) {}
for (var j = 0; j <treeData [i]. children.length; j + +)
try {if (/ \ S + \ (\ d + \) $ /. test (treeData [i]. children [j]. data.title)
{apex.jQuery ('li [id =' + treeData [i]. children [j]. attributes.id + '] a'). css ('color', 'red'). css ('font-weight', 'bold');}} catch (err) {}
Help please!
[Not correctly work: http://files.mail.ru/FHON5H|http://files.mail.ru/FHON5H]

It can be used static ID for node
In sql:
case when msg_count>0 then 'TreeRed_' || rownum
else 'TreeBlack_' || rownum
end as value,
In js:
$('[id^="TreeRed_"]').children('a').css('color', 'red').css('font-weight', 'bold');
How can I highlight node without renaming ID, couse I need ID for links?

Similar Messages

  • Highlight an ADF tree node when it is clicked

    Hello every onei ,
    Does anybody has any idea how to highlight an ADF tree node when it is clicked ?
    Here is my scenario:-
    I have a popup which has a tree component on left and when we click on any node in the tree we have to display the corresponding page on right side.
    As the tree is common for all pages in the popup, i created an XHTML template with tree. All the treenode pages will use this template to display the tree.This template i am using to implement in rest of the pages.
    So when i click any link on this tree will load the corresponding JSP. But i am loosing focus. i mean selected node is not highlighting. Because we are loading the entire target page with template.
    Could any let me know how to highlight the tree node ?
    The Main problem is we are not using ADF controllers. We are using managed beans, these managed beans attached to the JSPX pages.
    Kindly guide me if any one knows solution.
    Thanks & Regards,
    Sai Sravan.P

    Hello Sai,
    I am afraid you have posted your question in the wrong forum. This forum is about Oracle On Track Communication, a next-generation social enterprise collaboration product.
    Please re-post your question in an ADF related forum and I am sure someone will be able to answer.
    Thank you,
    Ernst.

  • Af:tree - how do I highlight the selected tree node?

    af:tree
    I checked the generated CSS file. I found that when a tree node is selected, the related CSS attribute is:
    .xj:link{
    font-family:Arial,Helvetica,Geneva,sans-serif;
    font-size:10pt;
    font-weight:normal;
    color:#663300
    I created a customized CSS attribute, but then all of the links have the customized CSS attributes.
    How do I just highlight the selected tree node link?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    try doing the onclick javascript method
    you have to place it on the node element and id must be made dynamic
    for this use 'this.id'
    by which the current id of the node is passed
    and by capturing the id name in a var
    use the same for invoking its selected property and make it true
    like this
    var currentid = this.id;
    this.form.currentid.selected = true;

  • Highlight the selected Tree Node

    Hello Everyone,
    Can someone plz tell me how to highlight the selected tree node ?
    After selection, user should be able to see which node was last selected.
    Thanks

    Hello,
    for me it is not really clear what you have done. Sorry!
    Because I have problems to paste code, I will describe how you can test that function.
    Take the BSP application HTMLB_SAMPLES and copy it to ZHTMLB_SAMPLES. Take page "treeviewSample.htm" and add the following node behind node22:
    <htmlb:treeNode id   = "node23"
                      text = "Node 2.2, normal text"
                      selection="PRIMARYSELECTION">
    Perhaps this will show you how it works and help you.
    As far as I can see the attribute "selection" can't be set via table.
    Best regads
    Renald
    Edited by: Renald Wittwer on Jan 21, 2010 1:36 PM

  • Tree using APEX 2.2

    Hi
    I have created a tree using APEX 2.2 and the wizard provided. The select for my tree is:
    select "NODE_PRIMARY_KEY" id,
    "NODE_FOREIGN_KEY" pid,
    CASE
    WHEN NODE_PRIMARY_KEY = :P6_SELECTED_PK THEN
    '<span style="color:white;background-color:#0000CD;">'|| NODE_LABEL||'</span>'
    ELSE
    NODE_LABEL
    END AS NAME,
    'f?p=&APP_ID.:6:&SESSION.::NO::P6_SELECTED_PK:'||"NODE_PRIMARY_KEY" link,
    NULL a1,
    null a2
    from "ADFY"."RRD_TREE_HIERARCHY"
    ORDER BY 1
    The above also highlights the current selected node. With a small data set the tree worked fine. Now that I have 'proper' data the tree's performance is not acceptable. I think the problem is due to the tree refreshing itself each time a node is selected. Is there anything that I can implement to stop this or to improve the performance of the tree?
    I have tried the 'Tree with AJAX' example but couldn't really get it to work.
    Thanks
    Paul

    Hi PARS,
    Try the below query, I tried to run your query in SQL command and got the same error. I corrected your query, now its running in SQL Command,
    select case when connect_by_isleaf = 1 then 0
                                                  when level = 1             then 1
                                               else                           -1end as status,
    level,
          apex_item.checkbox(1,empno,'')||ename as title,
           NULL as icon,
           EMPNO as value,
           null as tooltip,
           NULL as link
    from "EMP"
    start with "MGR" is null
    connect by prior "EMPNO" = "MGR"
    order siblings by "ENAME"
    Hope It will work...I too referred that link you shared for this. But I am not sure we can use checkbox in tree report. Because we don't have any option to change the column 'display as' like 'standard report column'. then only it will show like checkbox else it will show the code like '<input type="checkbox" name="f01" value="7839" />KING'.
    Thanks
    Lakshmi

  • Trees in Apex 4.0

    Hello,
    Is it possible to make the ajax tree in Apex 4.0 to "memorize" it's state between page loads ?
    Now it's always returned to it's original state after page reload, for example a folder is closed.
    Tiina

    Hi Tiina,
    If you wish to save the state of your tree, to expand the tree to the last selected node, you will need to use the 'Selected Node Page Item' attribute of your tree. Edit your tree and on the Tree Attributes page, set the 'Selected Node Page Item' to a page or application item that you wish to hold the selected node value e.g. P21_SELECTED_NODE as used in the Tree demonstration. Then update the link parameter in your tree query to set this item to the VALUE parameter of your query .e.g EMPNO. Now when you select a node, and return to the tree page, the tree will expand to that last selected node.
    You may find it useful to refer to a related thread on this topic: Re: tree question
    Regards,
    Hilary

  • Highlighting nodes in a JTree

    Hi,
    I'd like to know how I can produce the efect of highlighting nodes in a JTree when the mouse moves over the JTree.
    Thanks

    You say to get the mouseevent coordinates with a mouse
    listener, but which component should be the caller of
    the methos addMouseListener?
    If I choose the jtree, I can't get the 'mouseevent
    coordinates' each time the mouse moves over a node,
    because the methods mouseEntered and mouseExited are
    invoked just once (when the mouse enter inside the
    jtree's area (mouseEntered), and when the mouse gets
    out the jtree's area(mouseExited)), so I can't change
    the boolean field to true for nodes which have the
    mouse over.just use mouseMoved of the MouseMotionListener.
    however, i have my doubts that you will have a lot of fun with the suggested method (correct though it is).
    at least make sure you only call the repaint method if the mouse moved into a new node. you might want to try the the nodeChanged method, that way you don't repaint the whole tree every time.
    thomas

  • Implementing 3 level tree in Apex

    Hi Friends,
    I am trying to create a tree in apex. I am having 3 tables.
    1.Client
    2.Location
    3.Device. I am having an materialized view "device_detail_view" with columns "device_id","location_id","client_id". This
    Mview is having the "location_id" and the "client_id" for all devices. The corresponding client_name and location_name
    is stored in the tables "client" and "Location". I want a tree in which the "Client_name" will be the root node. When
    clicking on the client names all "location_name " assosiated with that need to be displayed. When clicking on a specific
    "location_name" all "device_name" assossiated with that device must be displayed.How can i achieve this. Any input will
    be appreciated.
    Regards,
    Jyothi

    Hi Hilary,
    Your example was just so wonderful.I have a question.My tree works well.I have a requirement to show my link page at the same page with my tree.How can I do that?
    For example I have
    'View' as tooltip,
    case when link_type = 'M'
    then 'f?p='||:APP_ID||':3:'||:APP_SESSION||'::NO:RIR'
    when link_type = 'C'
    then 'f?p='||:APP_ID||':3:'||:APP_SESSION||'::NO:CIR:IR_CATEGORY:'
    ||name
    when link_type = 'P'
    then 'f?p='||:APP_ID||':6:'||:APP_SESSION||'::NO::P6_PRODUCT_ID:'
    ||sub_id
    how can I redirect these pages to my tree page?
    Thank you in advance

  • Highlighting nodes in JTree

    Hey guys please help me for this.
    I want to generate a Tree. In which after some action a few nodes are selected.
    Now i want to highlight those selected node in the Tree. Is it possible ??
    Is anyone have any clue how to do that.
    Thanks in advance

    well, even I'm facing this issue in my application but i did a small workaround. I am sure there should be a better way of achieving this, which i hope someone will post in this thread.
    Use Html tags in displaying the highlighted node:
    DefaultMutableTreeNode node = new DefaultMutableTreeNode ("<html><b>node1</b></html>");
    Pankaj

  • How to get Text for nodes in Tree Structure

    Hi Friends,
    How to get Text for nodes in Tree Structure
    REPORT  YFIIN_REP_TREE_STRUCTURE  no standard page heading.
                       I N I T I A L I Z A T I O N
    INITIALIZATION.
    AUTHORITY-CHECK OBJECT 'ZPRCHK_NEW' :
                      ID 'YFIINICD' FIELD SY-TCODE.
      IF SY-SUBRC NE 0.
        MESSAGE I000(yFI02) with SY-TCODE .
        LEAVE PROGRAM.
      ENDIF.
    class screen_init definition create private.
    Public section
      public section.
        class-methods init_screen.
        methods constructor.
    Private section
      private section.
        data: container1 type ref to cl_gui_custom_container,
              container2 type ref to cl_gui_custom_container,
              tree type ref to cl_gui_simple_tree.
        methods: fill_tree.
    endclass.
    Class for Handling Events
    class screen_handler definition.
    Public section
      public section.
        methods: constructor importing container
                   type ref to cl_gui_custom_container,
                 handle_node_double_click
                   for event node_double_click
                   of cl_gui_simple_tree
                   importing node_key .
    Private section
      private section.
    endclass.
    *&                        Classes implementation
    class screen_init implementation.
    *&                        Method INIT_SCREEN
      method init_screen.
        data screen type ref to screen_init.
        create object screen.
      endmethod.
    *&                        Method CONSTRUCTOR
      method constructor.
        data: events type cntl_simple_events,
              event like line of events,
              event_handler type ref to screen_handler.
        create object: container1 exporting container_name = 'CUSTOM_1',
                       tree exporting parent = container1
                         node_selection_mode =
                cl_gui_simple_tree=>node_sel_mode_multiple.
        create object: container2 exporting container_name = 'CUSTOM_2',
        event_handler exporting container = container2.
    event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
        event-appl_event = ' '.   "system event, does not trigger PAI
        append event to events.
        call method tree->set_registered_events
             exporting events = events.
        set handler event_handler->handle_node_double_click for tree.
         call method: me->fill_tree.
      endmethod.
    *&                        Method FILL_TREE
      method fill_tree.
        data: node_table type table of abdemonode,
              node type abdemonode.
    types:    begin of tree_node,
              folder(50) type c,
              tcode(60) type c,
              tcode1(60) type c,
              tcode2(60) type c,
              text(60) type c,
              text1(60) type c,
              text2(60) type c,
              end of tree_node.
      data:  wa_tree_node type tree_node,
                t_tree_node type table of tree_node.
    wa_tree_node-folder = text-001.
    wa_tree_node-tcode  = text-002.
    wa_tree_node-text =  'Creditors ageing'.
    wa_tree_node-tcode1 = text-003.
    wa_tree_node-text1 =  'GR/IR aging'.
    wa_tree_node-tcode2 = text-004.
    wa_tree_node-text2 =  'Bank Balance'.
    append wa_tree_node to t_tree_node.
    clear wa_tree_node .
    wa_tree_node-folder = text-005.
    wa_tree_node-tcode  = text-006.
    wa_tree_node-text =  'Creditors ageing'.
    wa_tree_node-tcode1 = text-007.
    wa_tree_node-text1 =  'Creditors ageing'.
    wa_tree_node-tcode2 = text-008.
    wa_tree_node-text2 =  'Creditors ageing'.
    append wa_tree_node to t_tree_node.
    clear wa_tree_node .
    wa_tree_node-folder = text-009.
    wa_tree_node-tcode  = text-010.
    wa_tree_node-text =  'Creditors ageing'.
    wa_tree_node-tcode1 = text-011.
    wa_tree_node-text1 =  'Creditors ageing'.
    wa_tree_node-tcode2 = text-012.
    wa_tree_node-text2 =  'Creditors ageing'.
    append wa_tree_node to t_tree_node.
    clear wa_tree_node .
    node-hidden = ' '.                 " All nodes are visible,
        node-disabled = ' '.               " selectable,
        node-isfolder = 'X'.                                    " a folder,
        node-expander = ' '.               " have no '+' sign forexpansion.
        loop at t_tree_node into wa_tree_node.
          at new folder.
            node-isfolder = 'X'.                      " a folder,
            node-node_key = wa_tree_node-folder.
                   clear node-relatkey.
            clear node-relatship.
            node-text = wa_tree_node-folder.
            node-n_image =   ' '.
            node-exp_image = ' '.
            append node to node_table.
          endat.
         at new tcode .
            node-isfolder = ' '.                          " a folder,
            node-n_image =   '@CS@'.       "AV is the internal code
            node-exp_image = '@CS@'.       "for an airplane icon
            node-node_key = wa_tree_node-tcode.
             node-text = wa_tree_node-text .
                     node-relatkey = wa_tree_node-folder.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
          endat.
          append node to node_table.
        at new tcode1 .
            node-isfolder = ' '.                          " a folder,
            node-n_image =   '@CS@'.       "AV is the internal code
            node-exp_image = '@CS@'.       "for an airplane icon
            node-node_key = wa_tree_node-tcode1.
                     node-relatkey = wa_tree_node-folder.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
              node-text = wa_tree_node-text1.
         endat.
          append node to node_table.
           at new tcode2 .
            node-isfolder = ' '.                          " a folder,
            node-n_image =   '@CS@'.       "AV is the internal code
            node-exp_image = '@CS@'.       "for an airplane icon
            node-node_key = wa_tree_node-tcode2.
                     node-relatkey = wa_tree_node-folder.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
            node-text = wa_tree_node-text2.
         endat.
          append node to node_table.
        endloop.
        call method tree->add_nodes
             exporting table_structure_name = 'ABDEMONODE'
                       node_table = node_table.
      endmethod.
    endclass.
    *&                        Class implementation
    class screen_handler implementation.
    *&                        Method CONSTRUCTOR
      method constructor.
       create object: HTML_VIEWER exporting PARENT = CONTAINER,
                      LIST_VIEWER exporting I_PARENT = CONTAINER.
      endmethod.
    *&                 Method HANDLE_NODE_DOUBLE_CLICK
      method handle_node_double_click.
      case node_key(12).
    when 'Creditors'.
    submit YFIIN_REP_CREADITORS_AGING  via selection-screen and return.
    when  'Vendor'.
    submit YFIIN_REP_VENDOR_OUTSTANDING  via selection-screen and return.
    when 'Customer'.
    submit YFIIN_REP_CUSTOMER_OUTSTANDING  via selection-screen and
    return.
    when 'GR/IR'.
    submit YFIIN_REP_GRIR_AGING  via selection-screen and return.
    when 'Acc_Doc_List'.
    submit YFIIN_REP_ACCOUNTINGDOCLIST  via selection-screen and return.
    when 'Bank Bal'.
    submit YFIIN_REP_BANKBALANCE  via selection-screen and return.
    when 'Ven_Cus_Dtl'.
    submit YFIIN_REP_VENDORCUST_DETAIL via selection-screen and return.
    when 'G/L_Open_Bal'.
    submit YFIIN_REP_OPENINGBALANCE via selection-screen and return.
    when 'Usr_Authn'.
    submit YFIIN_REP_USERAUTHRIZATION via selection-screen and return.
    endcase.
      endmethod.
    endclass.
    Program execution ************************************************
    load-of-program.
      call screen 9001.
    at selection-screen.
    Dialog Modules PBO
    *&      Module  STATUS_9001  OUTPUT
          text
    module status_9001 output.
      set pf-status 'SCREEN_9001'.
      set titlebar 'TIT_9001'.
      call method screen_init=>init_screen.
    endmodule.                 " STATUS_9001  OUTPUT
    Dialog Modules PAI
    *&      Module  USER_COMMAND_9001  INPUT
          text
    module user_command_9001 input.
    endmodule.                 " USER_COMMAND_9001  INPUT
    *&      Module  exit_9001  INPUT
          text
    module exit_9001 input.
    case sy-ucomm.
    when 'EXIT'.
      set screen 0.
    endcase.
    endmodule.
            exit_9001  INPUT

    you can read  the table node_table with nody key value which imports when docubble click the the tree node (Double clifk event).
    Regards,
    Gopi .
    Reward points if helpfull.

  • How to get each node in tree?

    how to get each node in tree?
    Message was edited by:
    NikisinProblem

    how to get each node in tree?
    Since (as far as I know) treeNode is an interface, the real question to me is how are you implementing your treeNodes? Are you overriding the toString() method?

  • How to fill or bind data using Value Node in Tree Node

    Hi Gurus,
    Can anybody help me on how to fill data or bind data using Value Node in Tree Node View. I know how to create Tree Node but not able to show value on the UI in Tree View.
    Can u please let if anybody has done it?
    Thanks in advance.
    Madhusudan

    continued...
    TRY.
              lv_child = me->node_factory->get_proxy(
                        iv_bo = lv_value_node
                        iv_parent_proxy = me
                        iv_proxy_type = 'ZL_CLASS_CN02' ).
              lv_child->is_leaf = 'X'.
              APPEND lv_child TO rt_children.
            CATCH cx_sy_move_cast_error cx_sy_ref_is_initial.
          ENDTRY.
      In the above code iv_bo , lv_value_node will be the actual object of the second node or leaf node here, which will have the same structure of parent node along with data. After/before this, you would need to build table and refresh in do-prepare_output of IMPL class.In the above code iv_bo , lv_value_node will be the actual object of the second node or leaf node here, which will have the same structure of parent node along with data. After/before this, you would need to buid table and refresh in do-prepare_output of IMPL class.
    ztyped_context->resultlist->build_table( ).
      IF ztyped_context->resultlist->node_tab IS INITIAL.
        ztyped_context->resultlist->refresh( ).
      ENDIF.
    Also the EH_ONEXPAND has to be implemented and event handled in DO_HANDLE_EVENT. But this expand event has to be delegated to context node directly as CL_BSP_WD_CONTEXT_NODE_TREE will already have the implementation.
    ztyped_context->resultlist->expand_node( lv_event->row_key ).
    Where in result list is the node ZL_CLASS_CN00.
    After typing the whole content , i found this blog :). There are few things i have written more that in the blog.  /people/poonam.assudani/blog/2009/06/24/create-a-tree-view-display-in-crm-web-ui
    Regards,
    Karthik

  • How to select more than one node in tree

    Hi
    plz any one know how to select multi nodes in tree components ??
    i wana select two employees or more from tree in order to know their informations how can i do that
    10nx for help

    i can select them from different parents that depends on what i want to select Like:
    Admin-Sam
    -Dinda
    Users-David
    -Marylinn
    -Sandra
    for ex: i wana choose Sam , Sandra & David to view thier times and OT on selecting them

  • How to add child node in Tree table programmetically

    Jdev Version 11.1.1.4.0.
    I have created tree table programmetically in bean.
    I have to add child node to tree table component on button click event on page.
    Please let me know how to do this in bean.
    Regards,
    Kiran

    How are you creating the tree pro-grammatically?
    If you are adding a new node to underlying data structure and refresh the tree - the tree will get updated with the new data.
    Thanks,
    Navaneeth

  • How to add node in tree.

    hi all
    I want to add a new node to tree. Can we add new node to a tree? plz help me out.
    sarah

    hi Arun.
    My code will be something like this.
    DECLARE
    htree ITEM;
    rg_data RECORDGROUP;
    BEGIN
    -- Find the tree itself.
    htree := Find_Item('control.emp_tree');
    -- Find the record group.
    rg_data := FIND_GROUP('rg1');
    -- Add the new node at the top level and children.
    Ftree.Add_Tree_Data(htree,
    Ftree.ROOT_NODE,
    Ftree.PARENT_OFFSET,
    Ftree.LAST_CHILD,
    Ftree.RECORD_GROUP,
    rg_data);
    END;
    if i use add_tree but i think it will add all the same nodes down. guide me plz. i am confused.
    sarah

Maybe you are looking for

  • BP Transaction - Default values upon selection of BP role ?

    Hi All, I want to assign values to Grouping and Account Group fields in BP transaction in CRM. Is there any BADI or Userexit to achive the same. If possible kindly explain the steps to be implemented to use the BADI. Thanks & Regards, Navneeth K.

  • Password Protected pdf's

    I am trying to view a password protected PDF on an iPad but not having any success yet. I think I am transferring the PDF fine but can't get it to open.

  • All FLV files have removed themselves from the stage

    Hey Folks All my FLV Files are no longer on the stage where they had been placed. I moved the folder do I need to relink the paths and tell the program where all the FLVs are now? (like in final cut pro?) how would I do that if so.... thanks n

  • Installation of repository

    I downloaded Designer 6i to evaluate it. I have installed the client on Win 2000 and am now installing the repository on the server. I have configured the server and am now using the Repository Administrator Utility. I click Start to install the inst

  • Problem saving to pdf in print mode.

    Greetings. I am switching to Firefox to avoid frequent Safari crashes. However, when I attempt to save to a pdf from a web page, using the "Print" function, characters in the font in the web page are replaced in the pdf. For example, the word "proteg