Open Tree control in expanded state

I have built a small framework to display demos -- and use an
XML-driven tree component to provide access to demo segments and
published files.
I would like the TOC in the Tree component to open in
expanded state, but am having no luck with myTree.setIsOpen.
The tree connects to the XML OK -- I can expand/collapse,
etc... and it all looks great. But I cannlt get the tree to open
expanded.
The code I'm trying to open the TOC expanded:
this.demoTOC.setIsOpen(this.demoTOC.getTreeNodeAt(0), true);
The XML that's connected to the tree:
<?xml version="1.0" encoding="UTF-8"?>
<toc>
<demosection label="MY TITLE" >
<demo ID="00demo.flv" label="title01" isBranch="true"
/>
<demo ID="01demo.flv" label="title02" isBranch="true"
/>
<demo ID="02demo.flv" label="title03" isBranch="true"
/>
<demo ID="03demo.flv" label="title04" isBranch="true"
/>
</demosection>
</toc>
If anyone can point out what I'm doing wrong, I am ready to
learn.
Thx.

Never mind -- figured it out.
It was a scoping issue -- calling the setIsOpen form inside
the XML loader function.

Similar Messages

  • Open tree component in expanded state

    I have built a small framework to display demos -- and use an
    XML-driven tree component to provide access to demo segments and
    published files.
    I would like the TOC in the Tree component to open in
    expanded state, but am having no luck with myTree.setIsOpen.
    The tree connects to the XML OK -- I can expand/collapse,
    etc... and it all looks great. But I cannlt get the tree to open
    expanded.
    The code I'm trying to open the TOC expanded:
    this.demoTOC.setIsOpen(this.demoTOC.getTreeNodeAt(0), true);
    OR
    this.demoTOC.setIsOpen(this.demoTOC.getTreeNodeAt(0).getTreeNodeAt(0),
    true);
    The XML that's connected to the tree:
    <?xml version="1.0" encoding="UTF-8"?>
    <toc>
    <demosection label="MY TITLE" >
    <demo ID="00demo.flv" label="title01" isBranch="true"
    />
    <demo ID="01demo.flv" label="title02" isBranch="true"
    />
    <demo ID="02demo.flv" label="title03" isBranch="true"
    />
    <demo ID="03demo.flv" label="title04" isBranch="true"
    />
    </demosection>
    </toc>
    If anyone can point out what I'm doing wrong, I am ready to
    learn.
    Thx.

    Never mind -- figured it out.
    It was a scoping issue -- calling the setIsOpen form inside
    the XML loader function.

  • Embedding Tree control in TableView

    Hi all,
    I want to create a table which rows can be collapsed, looks like a tree embedded into a table.
    But we do not know how to implement it using Portal Applications. Can anyone send an example to do it?
    If I use CellRenderer to render tree control,After expanding the tree node,the subnodes are displayed in the same cell.But what I need is ,on expansion of tree the rows also should be expanded and collapsed accordingly.
    Thanks in Advance,
    Santhosh

    Hi Santhosh,
    Actually there is no need to use div tag. I am giving a sample code below. Try it and make the necessary modifications.
    <html>
         <head>
              <title>
                   Expand/Collapse
              </title>
              <script language='javascript'>
                   function toggle(divid)
                        obj=document.getElementById(divid);
                        visible=(obj.style.display!="none");
                        if(visible)
                             obj.style.display="none";
                        else
                             obj.style.display="block";
              </script>
         </head>
         <body>
              <table border=1>
                   <tr>
                        <td><a href=javascript:toggle("first")>First</a></td>
                   </tr>
                   <tr id="first" style="display: none;">
                        <td><b>This is the first text</b></td>
                   </tr>
                   <tr>
                        <td><a href=javascript:toggle("second")>Second</a></td>
                   </tr>
                   <tr id="second" style="display: none;">
                        <td><b>This is the second text</b></td>
                   </tr>
              </table>
         </body>
    </html>
    Hope this solves your problem.
    Ranjith

  • How to open child node in Tree control?

    Hi All,
    I am using arrayCollection in my tree control.
    I want to open one child node based on name of that node.
    How to open that chid node?
    I tried tree.OpenItems and ExpandItem methods. IT is not working. Any idea how to do it?

    write this statement
    TreeObject.expandItem("the branch",true)
    But make sure you dont call this statement right after you set the dataProvider for the tree object. Instead wait for a second or two and then call this statement. This delay is allow the tree object ot call it validate functions.
    Let me know if it helps

  • Af:tree control expand is not working

    Hi all ,
    af:tree control expansion is not working if I click on the + sign. But it is working thru context menu "Expand All Below" option.
    Can any one help me.
    Thanks
    Kristi
    Message was edited by:
    Kristi(user576892)

    Hi,
    not with this little information
    - which technology
    - which browser version (if applicable)
    - how to reproduce
    - does it reproduce on other machines / browsers
    Frank

  • How to open the file in a tree control

    I use a tree control to list all files in a selected directory, I checked the sample with LV (Directory hierarchy in tree control.vi) and want to add a function like following:
    Atfer listing all files, if I click a file listed in the tree control, the computer can open the file automaticly.

    Hi,
    you can use the "Open URL in Default Browser.vi" to open all the files you select in your tree.
    Mike
    Attachments:
    Directory Hierarchy in Tree Control_LV85.vi ‏35 KB

  • [UIX] Tree - expanded state problem

    Hi,
    I'm experiencing problemswith my UIX Tree.
    In my tree I expanded some nodes (so I can view its contents :))
    Normally when I browse to some other pages and come back to the page containing the tree, it remembered the state in which I left it (same nodes still expanded). When I decide to insert new data (through a form page)to the database of which the tree 'feeds' itself, I get errors when browsing back to the page containing the tree, because it remembers its last state (which is nolonger valid, because of new records).
    What I want is that I can go back to the page containing my tree, with the tree refreshed (containing my newly inserted data) and still leave those nodes expanded that expanded earlier.
    Is this possible? (And is my problem clear? ;) )
    Gr.
    Philip

    I'm afraid our proxy does not support mutable trees. The only way to have it work at all is to create a new proxy when you mutate the tree data, which means you will not be able to save the expanded/collapsed state.
    This won't help you now, but ADF UIX is being migrated to ADF Faces which is based on JSF. In that realease mutable trees will be supported. There are early access releases of ADF Faces available here if you're interested:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/index.html

  • Move collapsed group in tree control expands it

    In LV 2010, I have a tree control.  If I collapse a group and move it to a new location in the tree, it is expanded when I drop it in its new location.  Is this a configurable option?  A bug?

    Attached is a VI that shows what I'm talking about.  You collapse the group, drag and drop it to a new place in the tree, and it is automatically expanded.
    I believe I have the settings you specified.
    Attachments:
    tree control example.vi ‏6 KB

  • F.01 Tree Control Financial Statement

    Hi,
    When i run my report F.01 with Tree Control selected then it drills down till business area. The client wants to see this till Account. Is there any standard way or modification to do. Help required.
    Thanks

    Check if you can bring the Account Number from the change layout list of hidden fields.

  • Expand Tree Control

    I now have a Tree Control populated from an ArrayCollection
    and using the defaultDataDescriptor.
    At this point in the program the data exists only in the
    myTree.dataProvider and the root node is at myTree.dataProvider[0]
    or myTree.dataProvider.source[0] and I can see from the variables
    window that the correct data is located here.
    What do I have to put for 'item' in
    myTree.expandChildrenOf(??item??, true). Everything I can think of
    returns:
    "Cannot access a property or method of a null object
    reference."
    Does anyone have any idea how to make this work.
    Doug

    The error occurs in the Flex file Tree.as at line 1383.
    I can now see that the null object is not item -
    dataProvider[0], this contains the correct data. The problem is
    that iterator is null and therefore iterator.view is a null
    reference.
    Is there any way to solve this problem?
    My ArrayCollection is built in pretty much the same way as
    shown in:
    Flex 2 Developer's Guide > Building User Interfaces for
    Flex Applications > Using Data Providers and Collections
    > Using hierarchical data providers > Data descriptors and
    hierarchical data provider structure > Creating a custom data
    descriptor
    But I have used the defaultDataDescriptor and my arrays are
    not built from literals.
    Doug

  • Single click on tree control navigation

    Hello I have a tree control where I have include the navigation, I know that there is a method
    HANDLE_NODE_DOUBLE_CLICK FOR G_TREE
    but is there an method for only one click, I want to change my alv grid data when I click on several nodes in my tree control

    Hello Muhammet
    I have re-written my sample report ZUS_SDN_TWO_ALV_GRIDS into ZUS_SDN_TREE_AND_GRID_CONTROL which is now display a tree control together with the ALV grid.
    When you analyze this new report you will see that every step of the program logic is as I described in my previous e-mails.
    *& Report  ZUS_SDN_TWO_ALV_GRIDS
    *& Screen '0100' contains no elements.
    *& ok_code -> assigned to GD_OKCODE
    *& Flow logic:
    *  PROCESS BEFORE OUTPUT.
    *    MODULE STATUS_0100.
    *  PROCESS AFTER INPUT.
    *    MODULE USER_COMMAND_0100.
    *& Thread: single click on tree control navigation
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1143770"></a>
    REPORT  zus_sdn_tree_and_grid_control.
    TYPE-POOLS: abap, cntl.
    TYPES: node_table_type LIKE STANDARD TABLE OF mtreesnode
             WITH DEFAULT KEY.
    * CAUTION: MTREESNODE is the name of the node structure which must
    * be defined by the programmer. DO NOT USE MTREESNODE!
    CONSTANTS:
      BEGIN OF c_nodekey,
        root   TYPE tv_nodekey VALUE 'Root',                    "#EC NOTEXT
        child1 TYPE tv_nodekey VALUE 'Child1',                  "#EC NOTEXT
    *    child2 type tv_nodekey value 'Child2',                  "#EC NOTEXT
        new1   TYPE tv_nodekey VALUE 'New1',                    "#EC NOTEXT
        new2   TYPE tv_nodekey VALUE 'New2',                    "#EC NOTEXT
    *    new3   type tv_nodekey value 'New3',                    "#EC NOTEXT
    *    new4   type tv_nodekey value 'New4',                    "#EC NOTEXT
      END OF c_nodekey.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_cell_left     TYPE REF TO cl_gui_container,
      go_cell_right    TYPE REF TO cl_gui_container,
      go_tree          TYPE REF TO cl_gui_simple_tree,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
    **  go_grid2         TYPE REF TO cl_gui_alv_grid,
      gs_layout        TYPE lvc_s_layo.
    DATA:
      gt_knb1          TYPE STANDARD TABLE OF knb1,
      gt_knvv          TYPE STANDARD TABLE OF knvv.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_knb1      TYPE knb1.
        CHECK ( sender = go_grid1 ).
        READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
    **    CALL METHOD go_grid1->set_current_cell_via_id
    **      EXPORTING
    ***        IS_ROW_ID    =
    ***        IS_COLUMN_ID =
    **        is_row_no    = es_row_no.
    *   Triggers PAI of the dynpro with the specified ok-code
        CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    *       CLASS LCL_APPLICATION DEFINITION
    CLASS lcl_application DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          md_event       TYPE string     READ-ONLY,
          md_node_key    TYPE tv_nodekey READ-ONLY.
        CLASS-METHODS:
          handle_node_double_click
            FOR EVENT node_double_click
            OF cl_gui_simple_tree
            IMPORTING node_key,
          handle_expand_no_children
            FOR EVENT expand_no_children
            OF cl_gui_simple_tree
            IMPORTING node_key.
    ENDCLASS.                    "LCL_APPLICATION DEFINITION
    *       CLASS LCL_APPLICATION IMPLEMENTATION
    CLASS lcl_application IMPLEMENTATION.
      METHOD  handle_node_double_click.
        " this method handles the node double click event of the tree
        " control instance
        " show the key of the double clicked node in a dynpro field
        md_event = 'NODE_DOUBLE_CLICK'.
        md_node_key = node_key.
        " Trigger PAI and set ok-code = 'DETAIL'
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'DETAIL'
    *      IMPORTING
    *        rc       =
        MESSAGE md_node_key TYPE 'I'.
      ENDMETHOD.                    "HANDLE_NODE_DOUBLE_CLICK
      METHOD handle_expand_no_children.
        " this method handles the expand no children event of the tree
        " control instance
        DATA: node_table TYPE node_table_type,
              node TYPE mtreesnode.
        " show the key of the double clicked node in a dynpro field
        md_event = 'EXPAND_NO_CHILDREN'.
        md_node_key = node_key.
        IF node_key = 'Child1'.
    * add two nodes to the tree control (the children of 'Child1')
    * Node with key 'New1'
          CLEAR node.
          node-node_key = c_nodekey-new1.
          node-relatkey = c_nodekey-child1.
          node-relatship = cl_gui_simple_tree=>relat_last_child.
          node-isfolder = ' '.
          node-text = 'New1'(ne1).
          APPEND node TO node_table.
    * Node with key 'New2'
          CLEAR node.
          node-node_key = c_nodekey-new2.
          node-relatkey = c_nodekey-child1.
          node-relatship = cl_gui_simple_tree=>relat_last_child.
          node-n_image = '@10@'.
          node-expander = ' '.
          node-text = 'New2'(ne2).
          APPEND node TO node_table.
          CALL METHOD go_tree->add_nodes
            EXPORTING
              table_structure_name           = 'MTREESNODE'
              node_table                     = node_table
            EXCEPTIONS
              failed                         = 1
              error_in_node_table            = 2
              dp_error                       = 3
              table_structure_name_not_found = 4
              OTHERS                         = 5.
          IF sy-subrc <> 0.
    **        MESSAGE A000.
          ENDIF.
        ENDIF.
      ENDMETHOD.                    "HANDLE_EXPAND_NO_CHILDREN
    ENDCLASS.                    "LCL_APPLICATION IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  knb1 INTO TABLE gt_knb1 UP TO 100 ROWS
             WHERE  bukrs  = '1000'.
      PERFORM init_controls.
    * Display data
      gs_layout-grid_title = 'Customers: Sales Areas'.
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNVV'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_knvv
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    * Flow logic of dynpro (does not contain any dynpro elements):
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
    *  SET TITLEBAR 'xxx'.
    * Refresh display of detail ALV list
      CALL METHOD go_grid1->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      TRANSLATE gd_okcode TO UPPER CASE.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
    *   User has pushed button "Display Details"
        WHEN 'DETAIL'.
          MESSAGE gd_okcode TYPE 'I'.
          PERFORM entry_show_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  ENTRY_SHOW_DETAILS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM entry_show_details .
    * define local data
      DATA:
        ld_row      TYPE i,
        ls_knb1     TYPE knb1.
      IF ( gt_knvv IS INITIAL ).
        SELECT        * FROM  knvv INTO TABLE gt_knvv
        FOR ALL ENTRIES IN gt_knb1
           WHERE  kunnr  = gt_knb1-kunnr.
      ELSE.
        REFRESH: gt_knvv.
      ENDIF.
    ENDFORM.                    " ENTRY_SHOW_DETAILS
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 1
          columns           = 2
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_left.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 2
        RECEIVING
          container = go_cell_right.
    * Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent = go_cell_right
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click FOR go_grid1.
      PERFORM create_and_init_tree.
    ENDFORM.                    " INIT_CONTROLS
    *&      Form  CREATE_AND_INIT_TREE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM create_and_init_tree .
      DATA: lt_node_table TYPE node_table_type,
            lt_events TYPE cntl_simple_events,
            ls_event TYPE cntl_simple_event.
    * create a tree control
      CREATE OBJECT go_tree
        EXPORTING
          parent                      = go_cell_left
          node_selection_mode         = cl_gui_simple_tree=>node_sel_mode_single      " single node selection is used
        EXCEPTIONS
          lifetime_error              = 1
          cntl_system_error           = 2
          create_error                = 3
          failed                      = 4
          illegal_node_selection_mode = 5.
      IF sy-subrc <> 0.
    **    MESSAGE a000.
      ENDIF.
    * define the events which will be passed to the backend
      " node double click
      ls_event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
    **  ls_event-appl_event = 'X'. " process PAI if event occurs
      " NOTE: Do NOT register as application event !!!!!
      APPEND ls_event TO lt_events.
      CALL METHOD go_tree->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
    **    MESSAGE a000.
      ENDIF.
      SET HANDLER:
        lcl_application=>handle_node_double_click   FOR go_tree,
        lcl_application=>handle_expand_no_children  FOR go_tree.
    * add some nodes to the tree control
    * NOTE: the tree control does not store data at the backend. If an
    * application wants to access tree data later, it must store the
    * tree data itself.
      PERFORM build_node_table USING lt_node_table.
    * node_table_structure_name     = 'MTREESNODE'
    *   A programmer using the tree control must create a structure in the
    *   dictionary. This structure must include the structure TREEV_NODE
    *   and must contain a character field with the name 'TEXT'.
      CALL METHOD go_tree->add_nodes
        EXPORTING
          table_structure_name           = 'MTREESNODE'
          node_table                     = lt_node_table
        EXCEPTIONS
          failed                         = 1
          error_in_node_table            = 2
          dp_error                       = 3
          table_structure_name_not_found = 4
          OTHERS                         = 5.
      IF sy-subrc <> 0.
    **    MESSAGE a000.
      ENDIF.
    ENDFORM.                    " CREATE_AND_INIT_TREE
    *&      Form  build_node_table
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_node_table
      USING
        node_table TYPE node_table_type.
      DATA: node LIKE mtreesnode.
    * Build the node table.
    * Caution: The nodes are inserted into the tree according to the order
    * in which they occur in the table. In consequence, a node must not
    * occur in the node table before its parent node.
    * Node with key 'Root'
      node-node_key = c_nodekey-root.
      " Key of the node
      CLEAR node-relatkey.      " Special case: A root node has no parent
      CLEAR node-relatship.     " node.
      node-hidden = ' '.        " The node is visible,
      node-disabled = ' '.      " selectable,
      node-isfolder = 'X'.      " a folder.
      CLEAR node-n_image.       " Folder-/ Leaf-Symbol in state "closed":
      " use default.
      CLEAR node-exp_image.     " Folder-/ Leaf-Symbol in state "open":
      " use default
      CLEAR node-expander.      " see below.
      node-text = 'Root'(roo).
      APPEND node TO node_table.
    * Node with key 'Child1'
      node-node_key = c_nodekey-child1.
      " Key of the node
      " Node is inserted as child of the node with key 'Root'.
      node-relatkey = c_nodekey-root.
      node-relatship = cl_gui_simple_tree=>relat_last_child.
      node-hidden = ' '.
      node-disabled = ' '.
      node-isfolder = 'X'.
      CLEAR node-n_image.
      CLEAR node-exp_image.
      node-expander = 'X'. " The node is marked with a '+', although
      " it has no children. When the user clicks on the
      " + to open the node, the event
      " expand_no_children is fired. The programmer can
      " add the children of the
      " node within the event handler of the
      " expand_no_children event
      " (see method handle_expand_no_children
      " of class lcl_application)
      node-text = 'Child1'(ch1).
      node-style = cl_gui_simple_tree=>style_emphasized_positive.
      APPEND node TO node_table.
    ENDFORM.                    " build_node_table
    Regards
      Uwe

  • Flex tree control expanditem dynamically..?

    Hi All.,
               I have using tree control using to display. when i pass the data with folder id dynamically  to expanding particular child node of tree.
        How to extarct tree with dynamic...?
    Below sample coding.....
    <mx:tree id="folderTree" />
    folderid=2618;
         callLater(expandTree, [folderid]);
         private function expandTree(folderid: Object) : void
                    folderTree.expandChildrenOf(folderTree.getChildAt(0), true);
                    folderTree.selectedItem = folderid;
    but not extracting tree.
    anyone help this problem
    With Regards.,
    Lings

    Thanks buddy for the answer.
    Unfortunately the answer came after quite long time of posting the message. Anyway I was able to open a tree on demand using HttpService and due to my new requirement I changed it to RemoteObject.
    I my latest change I am able to populate tree nodes on demand and also the same solution if getting update from server via JMS using Consumer object.
    I kind a like this solution because it took me good amount of effort to find the right solution.
    If any one is intersted the he/she can reply to the post and I can provide code here or may at some location so that it can be easily downloaded.
    The solution is Flex-Grails combination.
    Thanks everybody.

  • Control Framework tree control event not trigerring

    The event handle_node_double_click is not trigerring on the tree controls . I want to display the contents of the nodes on the text editor on trigerring of this event
    *& Report  ZCONTROLS_TREE_TEDIT_SPITTER
    REPORT  zcontrols_tree_tedit_spitter.
    DATA : editor TYPE REF TO cl_gui_textedit,
           tree   TYPE REF TO cl_gui_simple_tree.
    DATA : container TYPE REF TO cl_gui_custom_container,
           splitter  TYPE REF TO cl_gui_easy_splitter_container,
           right     TYPE REF TO cl_gui_container,
           left      TYPE REF TO cl_gui_container.
    DATA : node_itab LIKE node_str OCCURS 0.
          CLASS EVENT_HANDLER DEFINITION
    CLASS event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS : handle_node_double_click
                  FOR EVENT NODE_DOUBLE_CLICK OF cl_gui_simple_tree
                  IMPORTING node_key.
    ENDCLASS.                    "EVENT_HANDLER DEFINITION
          CLASS EVENT_HANDLER IMPLEMENTATION
    CLASS event_handler IMPLEMENTATION.
      METHOD handle_node_double_click.
      perform node_double_click using node_key.
      ENDMETHOD.                    "HANDLE_NODE_DOUBLE_CLICK
    ENDCLASS.                    "EVENT_HANDLER IMPLEMENTATION
    data : handler1 type ref to event_handler.
    START-OF-SELECTION.
      CALL SCREEN 9001.
    *&      Module  start  OUTPUT
          text
    MODULE start OUTPUT.
      SET PF-STATUS 'ZSTAT1'.
      IF container IS INITIAL.
        CREATE OBJECT container
          EXPORTING
             container_name              = 'CONTAINER_NAME'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        CREATE OBJECT splitter
          EXPORTING
            parent            = container
            orientation       = 1
            name              = 'Mohit'
          EXCEPTIONS
            cntl_error        = 1
            cntl_system_error = 2
            OTHERS            = 3
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        left  = splitter->top_left_container.
        right = splitter->bottom_right_container.
        CREATE OBJECT editor
          EXPORTING
            parent                 = right
            name                   = 'MohitEditor'
          EXCEPTIONS
            error_cntl_create      = 1
            error_cntl_init        = 2
            error_cntl_link        = 3
            error_dp_create        = 4
            gui_type_not_supported = 5
            OTHERS                 = 6
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        CREATE OBJECT tree
          EXPORTING
            parent                      = left
            node_selection_mode         = tree->node_sel_mode_single
            name                        = 'MohitTree'
          EXCEPTIONS
            lifetime_error              = 1
            cntl_system_error           = 2
            create_error                = 3
            failed                      = 4
            illegal_node_selection_mode = 5
            OTHERS                      = 6
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        PERFORM fill_tree.
        CALL METHOD tree->add_nodes
          EXPORTING
            table_structure_name           = 'NODE_STR'
            node_table                     = node_itab
          EXCEPTIONS
            error_in_node_table            = 1
            failed                         = 2
            dp_error                       = 3
            table_structure_name_not_found = 4
            OTHERS                         = 5.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      create object handler1.
      set handler handler1->handle_node_double_click for tree.
      ENDIF.
    ENDMODULE.                 " start  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
          text
    MODULE user_command_9001 INPUT.
      CALL METHOD cl_gui_cfw=>dispatch.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Form  fill_tree
          text
    -->  p1        text
    <--  p2        text
    FORM fill_tree .
      DATA : node LIKE node_str.
      CLEAR node.
      node-node_key = 'head_mohit'.
      node-isfolder = 'X'.
      node-text = 'Mohit'.
      APPEND node TO node_itab.
      CLEAR node.
      node-node_key = 'Child1'.
      node-relatkey = 'head_mohit'.
      node-relatship = cl_gui_simple_tree=>relat_last_child.
      node-text = 'Mohit is the best '.
      APPEND node TO node_itab.
      CLEAR node.
      node-node_key = 'Child2'.
      node-relatkey = 'head_mohit'.
      node-relatship = cl_gui_simple_tree=>relat_last_child.
      node-text = 'Mohit is the bestest '.
      APPEND node TO node_itab.
      CLEAR node.
      node-node_key = 'head_JAIN'.
      node-isfolder = 'X'.
      node-text = 'jAIN'.
      APPEND node TO node_itab.
      CLEAR node.
      node-node_key = 'Child3'.
      node-relatkey = 'head_JAIN'.
      node-relatship = cl_gui_simple_tree=>relat_next_sibling.
      node-text = 'cnh INDIA '.
      APPEND node TO node_itab.
      CLEAR node.
      node-node_key = 'Child4'.
      node-relatkey = 'head_JAIN'.
      node-relatship = cl_gui_simple_tree=>relat_last_child.
      node-text = 'SAP  '.
      APPEND node TO node_itab.
    ENDFORM.                    " fill_tree
    *&      Form  node_double_click
          text
         -->P_NODE_KEY  text
    form node_double_click  using  p_node_key type TV_NODEKEY.
    DATA : node LIKE node_str.
    DATA textline(256).
    DATA text_table LIKE STANDARD TABLE OF textline.
    READ TABLE node_itab WITH KEY node_key = p_node_key
                             INTO node.
    endform.                    " node_double_click
    *&      Module  exit  INPUT
          text
    module exit input.
    CASE sy-ucomm.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
    ENDCASE.
    endmodule.                 " exit  INPUT

    Hello Mohit
    Here is a sample routine (taken from BCALV_TREE_02) which you have to add and adapt for your report. It does two things:
    1. Register events that should be handled (required but not sufficient for event handling)
    2. Set event handler for registered events
    The first step is different from ALV grid controls because here all events are already registered with the control (not the control framework).
    Set the event handler (statement SET HANDLER) registers the event handling with the control framework.
    FORM register_events.
    *§4. Event registration: tell ALV Tree which events shall be passed
    *    from frontend to backend.
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event,
            l_event_receiver TYPE REF TO lcl_tree_event_receiver.
    *§4a. Frontend registration(i):  get already registered tree events.
    * The following four tree events registers ALV Tree in the constructor
    * method itself.
    *    - cl_gui_column_tree=>eventid_expand_no_children
    * (needed to load data to frontend when a user expands a node)
    *    - cl_gui_column_tree=>eventid_header_context_men_req
    * (needed for header context menu)
    *    - cl_gui_column_tree=>eventid_header_click
    * (allows selection of columns (only when item selection activated))
    *   - cl_gui_column_tree=>eventid_item_keypress
    * (needed for F1-Help (only when item selection activated))
    * Nevertheless you have to provide their IDs again if you register
    * additional events with SET_REGISTERED_EVENTS (see below).
    * To do so, call first method  GET_REGISTERED_EVENTS (this way,
    * all already registered events remain registered, even your own):
    call method g_alv_tree->get_registered_events
          importing events = lt_events.
    * (If you do not these events will be deregistered!!!).
    * You do not have to register events of the toolbar again.
    *§4b. Frontend registration(ii): add additional event ids
      l_event-eventid = cl_gui_column_tree=>eventid_node_double_click.
      APPEND l_event TO lt_events.
    *§4c. Frontend registration(iii):provide new event table to alv tree
      CALL METHOD g_alv_tree->set_registered_events
        EXPORTING
          events = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.     "#EC NOTEXT
      ENDIF.
    *§4d. Register events on backend (ABAP Objects event handling)
      CREATE OBJECT l_event_receiver.
      SET HANDLER l_event_receiver->handle_node_double_click FOR g_alv_tree.
    ENDFORM.                               " register_events
    Regards
      Uwe

  • S_ALR_87012284 -  List Output - ALV Tree Control

    Dear Friends,
    In Standard Financial statement report when I use List output  -> ALV Tree Control  lay out. In the display area is it possible to save the expanded folders  in lay out. So that next time when I run the report with the same ALV Tree Contorl lay out, I would like to see folders expanded.
    Thanks,
    Venky

    Hi Venky,
    There is no way to have expanded tree list. You must hit Expand tree button to.
    You can also use ttrasaction code F.01 for balance sheet.
    Best regards

  • UIX:Tree Control

    Hi,
    Has anybody used or know to use the UIX:Tree control part of the UIX Simple JSP Components? If so can you please tell me if this helps creating a DHTML Tree component?
    Thanks
    mn

    Hello there,
    You should check out the "Data Trees" chapter of the UIX Developer's Guide. It goes into a lengthy description of the tree component and how to code it in UIX. The tree component does not use DHTML, but rather rerenders based on its state (what is expanded and collapsed).

Maybe you are looking for