Editable Recursive Tree

hi evreyone
I need to create an editable tree based on (one table called Locations)
this is the structure of this table
LocationNo
LocationName
ParentLocationNo
LocationNo and ParentLocationNo are Forign keys
according to what I've red I should use a recursive tree (Self-Reference forign key)
using a view that represent the tree (nodes & branches)
how can I create this tree (with Details Steps) ?
I am using
Jdeveloper 11.1.1.2.0
JHeadstart 11.1.1.2.29
thanks

hi
According to chapter 5 "Creating Tree Layouts", 5.7.4 "Variation: Recursive Tree"
I've created a Recursive Tree based on table call (Location)
but the problem is how can I refresh the data ... I mean .. How can I See the new record that I've
created in the same tree without moving in it (to make a refresh)
thanks

Similar Messages

  • Synchronize recursive tree with edit form

    Hi,
    I am trying to synchronize recursive tree with form, i have followed this post exactly Oracle ADF Developer: ADF - Synchronizing form with recursive tree
    the first level of the tree works but the inner levels does not.
    I am using JDEV 11.1.2.3

    Try sample 83 here -
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples

  • Recursive Tree  using Web Dynpro java

    Hi
    I've been trying to create a recursive tree using java in Web Dynpro.
    Can you please suggest a good example to try with?

    Hi,
    Check the below links....
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/integration%20of%20a%20tree%20structure%20in%20a%20web%20dynpro%20table.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf
    http://help.sap.com/saphelp_nw70/helpdata/en/13/4cde139306304480e89d815ffcf891/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/af/44ea406c9d3d43e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/21/ad884118aa1709e10000000a155106/frameset.htm
    Code Example,
    http://help.sap.com/saphelp_nw70/helpdata/en/16/1ec1814e566f4baf943c53ccf48552/frameset.htm
    null

  • Menu option under recursive tree item/folder & checkbox in tree

    Hi,
    I want to present a checkbox next to an item or folder in a recursive tree.
    I didn't see any option to do it so I tried to add a menu and a menu option type checkbox under the node item and note type.
    The issue it does nothing.
    Any ideas?
    THanks,
    Itay

    Hi Akshay,
    Everything mentioned here step by step:
    0. You cannot use check-boxes inside tree, so you have to emulate them with images (or use Table with Tree-like master column -- not discussed in this message)
    1. Create boolean attribute <b>isChecked</b> in node
    2. Create calculated read-only string attribute cbIcon, write following in generated getter function:
    return element.getIsChecked() ?
      "~sapicons/b_okay.gif" : "~sapicons/b_canc.gif";
    or whatever images you are using.
    3. Create & bind action onAction for TreeNode / TreeItem.
      -- apply parameters mapping in wdDoModifyView:
    if ( firstTime )
      final IWDTreeNodeType treeNode = (IWDTreeNodeType)
        view.getElement("<your-tree-node-element-id>");
      treeNode.mappingOfOnAction()
        .addSourceMapping("path", "selectedElement");
      <b>Your action must define parameter with type of your node element and name <i>selectedElement</i></b>
      -- write the following code for handler:
    selectedElement.setIsSelected( !selectedElement.getIsSelected() );
    4. Bind cbIcon attribute as TreeNode / TreeItem image source, bind rest of attributes.
    --Done.
    VS

  • Editable ALV Tree

    Hello All,
    I am trying to make an Editable ALV tree ..but cannot find the
    I have used fieldcat -edit = X but it only works for GRID ALV and not TREE ALV ...
    Please help me on this .....
    Edited by: Karan Chopra on Aug 2, 2010 1:11 PM

    Hi Karan
    CL_GUI_ALV_TREE is only a display tool.
    It has not a feature for editable data unfortunately.
    I was used a popup input screen on cell "double click" event to change the data in a cell
    in one of my projects.
    Maybe it can be a solution for u .

  • Selection of elements in a recursive tree structure

    Hello,
    I have a recursive tree structure, and I am dynamically creating the child nodes as the parent nodes get expanded. The structure at runtime after expansion of the nodes would look something like this:
    Node 1
    ---Node 1.1
    Leaf 1.1.1
    Leaf 1.1.2
    Leaf 1.1.3
    ---Node 1.2
    Leaf 1.2.1
    Leaf 1.2.2
    Node 2
    ---Node 2.1
    Leaf 2.1.1
    ---Node 2.2
    Leaf 2.2.1
    Leaf 2.2.2
    When I select an item, say Leaf 1.1.1, that item gets highlighted. Now, when I select another node, say Node 2.1, that item gets highlighted as well. The issue now is that both Leaf 1.1.1 and Node 2.1 are highlighted, although I want only the latest selection to be highlighted.
    I have the following settings on my context node of the tree:
    Initialization Lead Selection = False
    Singleton = False
    Selection = 0..1
    How can I get only the latest selection to be highlighted on the tree?

    Hi Venkatramanan,
    You are right - the lead selection works perfectly, and it is just an issue with the appearance. But even so, I would like to know if there is some way to control the visual highlighting of the nodes. The main cause of concern is that for a user, if he selects leaf 1 first, and then leaf 2 (from another node) next, both are highlighted, and there is no way to know which one is really selected.
    I did look at the component WDR_TEST_EVENTS. The dyn-load recursive tree does not appear to have this problem, but I could not find any special handling in the code.
    One more thing: I have the ignoreAction attribute set to true for all the parent nodes. The leaves have this attribute set to false, so they can be selected. But this does not seem to help with the highlighting issue.
    Thanks,
    Kamal

  • Recursive tree issue

    Hello!
    I have made a view object with self referencing view link, dropped the data control onto page, added a rule, chosen attributes.
    It works fine, but the tree initially displays all the table rows, since the tree uses a single view object and query is not limiting the data because if i limit it for selecting only root records, the children won't be seen, of course. How to construct a recursive tree, so that it would initially have only root records on top?
    Thank you!

    This is in 11.1.1.4 btw.
    Here's the stack trace if it helps:
    java.lang.IllegalStateException: ADF_FACES-60025:Error trying to change index from: 0 to: 1 rowCount: 2.
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel.setRowIndex(FlattenedTreeCollectionModel.java:171)
         at oracle.adfinternal.view.faces.renderkit.rich.TreeRendererUtils$1.setRowIndex(TreeRendererUtils.java:568)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.renderDataBlockRows(TableRenderer.java:1860)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.encodeAll(TableRenderer.java:613)
         at oracle.adfinternal.view.faces.renderkit.rich.TreeTableRenderer.encodeAll(TreeTableRenderer.java:600)
    Caused by: java.lang.IllegalStateException: ADFv: Not inside a container.
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.exitContainer(FacesCtrlHierBinding.java:673)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel._scrollForward(FlattenedTreeCollectionModel.java:260)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel._scrollIndex(FlattenedTreeCollectionModel.java:221)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel._scrollRepeatedly(FlattenedTreeCollectionModel.java:190)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel._scrollFromTop(FlattenedTreeCollectionModel.java:183)
         at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel.setRowIndex(FlattenedTreeCollectionModel.java:152)
    We have a copy of the adf 11.1.1.4 source and I checked FlattenedTreeCollectionModel.setRowIndex(FlattenedTreeCollectionModel.java:171) but it doesn't reveal anything. I see the part that rethrows the IllegalStateException, e.g.:
    try
    //more code here
    catch (IllegalStateException e)
    IllegalStateException exp =
    new IllegalStateException(LoggerUtils.getMessage(
    LOG, LoggerBundle.EXCCHANGE_INDEX, new Object[]{_index,index,_rowCount}));
    exp.initCause(e);
    throw exp;
    But I can't find the part that actually throws the IllegalStateException. I'm looking for an explanation as to why this is happening. I understand the solutions above worked for some people but there never was an explanation about what the error is about (e.g. why did the exception happen). The error message is far too cryptic and does not really establish what could be wrong which is just annoying as hell.

  • Add/Edit/Delete Tree Nodes using CL_GUI_ALV_TREE

    Hi All,
    I am looking for an example of program with CL_GUI_ALV_TREE that have a functionality of add a tree node, edit a tree node, and delete a tree node.
    I have already looked the BCALV_TREE* demo program but could not able to find a program to add/edit/delete node tree elements.
    Any info on this.
    Thanks
    aRs

    Hello aRs
    Here is a sample report showing how to delete nodes in an ALV tree. The report was copied from BCALV_TREE_01. Search for added code:
    *$ADDED: begin
    *$ADDED: end[/code]
    When you display the tree expand the first folder completely. When entering 'DELETE' into the command field directly the first flight date node will be deleted.
    REPORT ZUS_SDN_BCALV_TREE_01_DELNODE.
    based on: REPORT  bcalv_tree_01.
    Purpose:
    ~~~~~~~~
    This report shows the essential steps to build up a hierarchy
    using an ALV Tree Control (class CL_GUI_ALV_TREE).
    Note that it is not possible to build up this hierarchy
    using a simple ALV Tree Control (class CL_GUI_ALV_TREE_SIMPLE).
    To check program behavior
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    Start this report. The hierarchy tree consists of nodes for each
    month on top level (this level can not be build by a simple ALV Tree
    because there is no field for months in our output table SFLIGHT.
    Thus, you can not define this hierarchy by sorting).
    Nor initial calculations neither a special layout has been applied
    (the lines on the right do not show anything).
    Note also that this example does not build up and change the
    fieldcatalog of the output table. For this reason, all fields
    of the output table are shown in the columns although the fields
    CARRID and FLDATE are already placed in the tree on the left.
    (Of course, this is not a good style. See BCALV_TREE_02 on how to
    hide columns).
    Essential steps (Search for '§')
    ~~~~~~~~~~~~~~~
    1.Usual steps when using control technology.
       1a. Define reference variables.
       1b. Create ALV Tree Control and corresponding container.
    2.Create Hierarchy-header
    3.Create empty Tree Control
    4.Create hierarchy (nodes and leaves)
       4a. Select data
       4b. Sort output table according to your conceived hierarchy
       4c. Add data to tree
    5.Send data to frontend.
    6.Call dispatch to process toolbar functions
    *$ADDED: begin
    DATA:
      gd_del_nkey      TYPE lvc_nkey.
    *$ADDED: end
    §1a. Define reference variables
    DATA: g_alv_tree         TYPE REF TO cl_gui_alv_tree,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    DATA: gt_sflight      TYPE sflight OCCURS 0,      "Output-Table
          ok_code LIKE sy-ucomm,
          save_ok LIKE sy-ucomm,           "OK-Code
          g_max TYPE i VALUE 255.
    END-OF-SELECTION.
      CALL SCREEN 100.
    *&      Module  PBO  OUTPUT
          process before output
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAINTITLE'.
      IF g_alv_tree IS INITIAL.
        PERFORM init_tree.
        CALL METHOD cl_gui_cfw=>flush
          EXCEPTIONS
            cntl_system_error = 1
            cntl_error        = 2.
        IF sy-subrc NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = 'Automation Queue failure'(801)
              txt1  = 'Internal error:'(802)
              txt2  = 'A method in the automation queue'(803)
              txt3  = 'caused a failure.'(804).
        ENDIF.
      ENDIF.
    ENDMODULE.                             " PBO  OUTPUT
    *&      Module  PAI  INPUT
          process after input
    MODULE pai INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'EXIT' OR 'BACK' OR 'CANC'.
          PERFORM exit_program.
    *$ADDED: begin
        WHEN 'DELETE'.
          CALL METHOD g_alv_tree->delete_subtree
            EXPORTING
              i_node_key                = gd_del_nkey
             I_UPDATE_PARENTS_EXPANDER = SPACE
              i_update_parents_folder   = 'X'
            EXCEPTIONS
              node_key_not_in_model     = 1
              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.
          CALL METHOD g_alv_tree->frontend_update.
    *$ADDED: end
        WHEN OTHERS.
    §6. Call dispatch to process toolbar functions
          CALL METHOD cl_gui_cfw=>dispatch.
      ENDCASE.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                             " PAI  INPUT
    *&      Form  init_tree
          text
    -->  p1        text
    <--  p2        text
    FORM init_tree.
    §1b. Create ALV Tree Control and corresponding Container.
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c.
      l_tree_container_name = 'CCONTAINER1'.
      CREATE OBJECT g_custom_container
         EXPORTING
               container_name = l_tree_container_name
         EXCEPTIONS
               cntl_error                  = 1
               cntl_system_error           = 2
               create_error                = 3
               lifetime_error              = 4
               lifetime_dynpro_dynpro_link = 5.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'(100).
      ENDIF.
    create tree control
      CREATE OBJECT g_alv_tree
        EXPORTING
            parent              = g_custom_container
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
            item_selection      = 'X'
            no_html_header      = 'X'
            no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    §2. Create Hierarchy-header
    The simple ALV Tree uses the text of the fields which were used
    for sorting to define this header. When you use
    the 'normal' ALV Tree the hierarchy is build up freely
    by the programmer this is not possible, so he has to define it
    himself.
      DATA l_hierarchy_header TYPE treev_hhdr.
      PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
    §3. Create empty Tree Control
    IMPORTANT: Table 'gt_sflight' must be empty. Do not change this table
    (even after this method call). You can change data of your table
    by calling methods of CL_GUI_ALV_TREE.
    Furthermore, the output table 'gt_outtab' must be global and can
    only be used for one ALV Tree Control.
      CALL METHOD g_alv_tree->set_table_for_first_display
        EXPORTING
          i_structure_name    = 'SFLIGHT'
          is_hierarchy_header = l_hierarchy_header
        CHANGING
          it_outtab           = gt_sflight. "table must be empty !
    §4. Create hierarchy (nodes and leaves)
      PERFORM create_hierarchy.
    §5. Send data to frontend.
      CALL METHOD g_alv_tree->frontend_update.
    wait for automatic flush at end of pbo
    ENDFORM.                               " init_tree
    *&      Form  build_hierarchy_header
          build hierarchy-header-information
         -->P_L_HIERARCHY_HEADER  strucxture for hierarchy-header
    FORM build_hierarchy_header CHANGING
                                   p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Month/Carrier/Date'(300).
      p_hierarchy_header-tooltip = 'Flights in a month'(400).
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ' '.
    ENDFORM.                               " build_hierarchy_header
    *&      Form  exit_program
          free object and leave program
    FORM exit_program.
      CALL METHOD g_custom_container->free.
      LEAVE PROGRAM.
    ENDFORM.                               " exit_program
    *&      Form  create_hierarchy
          text
    -->  p1        text
    <--  p2        text
    FORM create_hierarchy.
      DATA: ls_sflight TYPE sflight,
            lt_sflight TYPE sflight OCCURS 0,
            l_yyyymm(6) TYPE c,            "year and month of sflight-fldate
            l_yyyymm_last(6) TYPE c,
            l_carrid LIKE sflight-carrid,
            l_carrid_last LIKE sflight-carrid.
      DATA: l_month_key TYPE lvc_nkey,
            l_carrid_key TYPE lvc_nkey,
            l_last_key TYPE lvc_nkey.
    §4a. Select data
      SELECT * FROM sflight INTO TABLE lt_sflight UP TO g_max ROWS.
    §4b. Sort output table according to your conceived hierarchy
    We sort in this order:
       year and month (top level nodes, yyyymm of DATS)
         carrier id (next level)
            day of month (leaves, dd of DATS)
      SORT lt_sflight BY fldate0(6) carrid fldate6(2).
    Note: The top level nodes do not correspond to a field of the
    output table. Instead we use data of the table to invent another
    hierarchy level above the levels that can be build by sorting.
    §4c. Add data to tree
      LOOP AT lt_sflight INTO ls_sflight.
    Prerequesite: The table is sorted.
    You add a node everytime the values of a sorted field changes.
    Finally, the complete line is added as a leaf below the last
    node.
        l_yyyymm = ls_sflight-fldate+0(6).
        l_carrid = ls_sflight-carrid.
    Top level nodes:
        IF l_yyyymm <> l_yyyymm_last.      "on change of l_yyyymm
          l_yyyymm_last = l_yyyymm.
    *Providing no key means that the node is added on top level:
          PERFORM add_month USING    l_yyyymm
                                 CHANGING l_month_key.
    The month changed, thus, there is no predecessor carrier
          CLEAR l_carrid_last.
        ENDIF.
    Carrier nodes:
    (always inserted as child of the last month
    which is identified by 'l_month_key')
        IF l_carrid <> l_carrid_last.      "on change of l_carrid
          l_carrid_last = l_carrid.
          PERFORM add_carrid_line USING    ls_sflight
                                           l_month_key
                                  CHANGING l_carrid_key.
        ENDIF.
    Leaf:
    (always inserted as child of the last carrier
    which is identified by 'l_carrid_key')
        PERFORM add_complete_line USING  ls_sflight
                                         l_carrid_key
                                CHANGING l_last_key.
      ENDLOOP.
    ENDFORM.                               " create_hierarchy
    *&      Form  add_month
    FORM add_month  USING     p_yyyymm TYPE c
                              p_relat_key TYPE lvc_nkey
                    CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_sflight TYPE sflight,
            l_month(15) TYPE c.            "output string for month
    get month name for node text
      PERFORM get_month USING p_yyyymm
                        CHANGING l_month.
      l_node_text = l_month.
    add node:
    ALV Tree firstly inserts this node as a leaf if you do not provide
    IS_NODE_LAYOUT with field ISFOLDER set. In form 'add_carrid_line'
    the leaf gets a child and thus ALV converts it to a folder
    automatically.
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_sflight
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_month
    FORM add_carrid_line USING     ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_sflight TYPE sflight.
    add node
    ALV Tree firstly inserts this node as a leaf if you do not provide
    IS_NODE_LAYOUT with field ISFOLDER set. In form 'add_carrid_line'
    the leaf gets a child and thus ALV converts it to a folder
    automatically.
      l_node_text =  ps_sflight-carrid.
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_sflight
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_carrid_line
    *&      Form  add_complete_line
    FORM add_complete_line USING   ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value.
      WRITE ps_sflight-fldate TO l_node_text MM/DD/YYYY.
    add leaf:
    ALV Tree firstly inserts this node as a leaf if you do not provide
    IS_NODE_LAYOUT with field ISFOLDER set.
    Since these nodes will never get children they stay leaves
    (as intended).
      CALL METHOD g_alv_tree->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          is_outtab_line   = ps_sflight
          i_node_text      = l_node_text
        IMPORTING
          e_new_node_key   = p_node_key.
    *$ADDED: begin
      IF ( ps_sflight-fldate = '20040522' ).  " first flight date
        IF ( gd_del_nkey IS INITIAL ).  " collect only first date
          gd_del_nkey = p_node_key.
        ENDIF.
      ENDIF.
    *$ADDED: end
    ENDFORM.                               " add_complete_line
    *&      Form  GET_MONTH
          text
         -->P_P_YYYYMM  text
         <--P_L_MONTH  text
    FORM get_month USING    p_yyyymm
                   CHANGING p_month.
    Returns the name of month according to the digits in p_yyyymm
      DATA: l_monthdigits(2) TYPE c.
      l_monthdigits = p_yyyymm+4(2).
      CASE l_monthdigits.
        WHEN '01'.
          p_month = 'January'(701).
        WHEN '02'.
          p_month = 'February'(702).
        WHEN '03'.
          p_month = 'March'(703).
        WHEN '04'.
          p_month = 'April'(704).
        WHEN '05'.
          p_month = 'May'(705).
        WHEN '06'.
          p_month = 'June'(706).
        WHEN '07'.
          p_month = 'July'(707).
        WHEN '08'.
          p_month = 'August'(708).
        WHEN '09'.
          p_month = 'September'(709).
        WHEN '10'.
          p_month = 'October'(710).
        WHEN '11'.
          p_month = 'November'(711).
        WHEN '12'.
          p_month = 'December'(712).
      ENDCASE.
      CONCATENATE p_yyyymm+0(4) '->' p_month INTO p_month.
    ENDFORM.                               " GET_MONTH
    /code
    Regards
      Uwe

  • CLOSED- Recursive Tree with Recursive Table and seperate Relationship table

    Hi All,
    I am trying to achieve a adf recursive tree with recursive table but relationships are stored in separate table like
    Table A:
    id name
    1 Val1
    2 Val2
    3 Val3
    4 Val4
    5 Val5
    Table B:
    fromid rel_type toid
    1 Parent-of 2
    2 Parent-of 3
    3 Parent-of 4
    1 Parent-of 5
    I did lots of reading from forum and various posts but couldn't make it work.
    Any suggestion what would be best approach and/or sample code for this ?
    Thanks

    I think that you can get this done by defining a VO that fetches all the top level nodes and have a view link to a VO that has all the details with a self recursive viewlink
    Query for the top level
    Select A.id, A.name
    from A
    Where A.id not in (select disctinct toid from B)
    Query for the detail level
    Select A.id, A.name, B.from, B.to
    from A,b
    where a.id = b.toid;
    ViewLink is going to be:
    detail.from=master.id
    and another viewlink for the recursive relationship
    detail.from=detail.to

  • Raise event when user select a node or leaf of a recursive tree

    What is the event when user choose a node or leaf of a recursive tree? When I select the tree node / leaf it does not raise the event in OnAction. Thanks!

    Hi,
    TreeNodeType and TreeItemType have ONACTION event assocaited with them. This event gets called when the node or leaf is selected by user. Put a break point in these method, then you'll call to know if they are actually getting called or not.

  • Display recursive tree expanded upto element level

    Hi all,
    I have created a Recursive tree. I want to show expanded tree upto element level. I saw EXPAND_INTO_ELEMENT mehod of IF_WD_TABLE_METHOD_HNDL and  SET_ON_EXPAND_ALL from class cl_wd_tree. Is it useful for me.
    Please suggest how it works for me.
    Thanks
    Sanket

    Any suggestions.

  • EDIT ALV TREE

    Hi all,
    I followed SAP example program to create 'COLUMN structure ALV tree' to diaplay and i have to make some of the fields as editable and get back the changed values in the internal table.Here i did not use field catalog at all.
    I used  gui_custom_container,cl_gui_custom_container,cl_gui_column_tree ...and added every column to the the tree object .Built the node with two internal table(like order header & order item ) to form a tree.How should i get the changed values in the internal table when user changes values in Colums of order item node.
    Any help is appreciated.
    thanks,
    dan.

    Hello all,
    Thanks for you reponses.I was actually referring  COLUMN_TREE_CONTROL_DEMOF01,now kind of changing the code like BCALV_TREE_DEMO, BCALV_TREE_SIMPLE_DEMO .Looks like i can make the field as editable by changing the edit field in layout object.But unlike  'GRID' object this tree object is not having any method like 'check_change_data' .
    How to get back the changed/values in iternal table or by any other means.
    Any idea of getting changed values from ALV tree object would be really helpful.
    thanks,
    dan

  • Editing non-tree cells problem in JTreeTable

    Hello all,
    I've been playing around with the JTreeTable for quite a while and have a fairly good grip on it. However, I've run into a problem that involves the display of cell data in the non-tree cells.
    Assume I have a JTreeTable with one node below the root (and the root node is not displayed). Also assume I've edited some information in one of the other cells in a 5-celled JTreeTable. The JTreeTable behaves normally with regard to editing/setting the values of the table cells.
    Now, with the click of a separate button, I programmatically create a new node in the JTree. I update the JTree model with a call to nodeChanged() and nodeStructureChanged() (or I could call reload() - both seem to work).
    This successfully adds a node, but in the process clears the entire remainder of the table's cell values. If I call fireTableDataChanged(), then the display of the JTree gets all screwed up (basically what happens to the display if you add/remove nodes, but don't update the display in a JTree). Not only that, but the fireTableDataChanged() method still does not redisplay my cell information for the remainder of the table.
    I'm at a loss to figure out what's responsible for this. The tableCellRenderer seems to work just fine until I add node. Even then, the tableCellRenderer for the JTree still works until I call fireTableDataChanged().
    Any ideas?
    Thank you,
    Brion Swanson

    I use a JTreeTable and in looking at my code, I've
    noticed that I make use of treeTable.repaint() fairly
    frequently (as whenever I update my stuff).Did the treeTable.updateUI do funky things to your JTree? It does on mine if I do a programmatic node addition or removal (basically any change to the tree structure will cause treeTable.updateUI() to completely destroy the display of the tree). This is a separate issue, but I thought I'd ask anyway since you seem to have run into at least a few of the same problems I'm experiencing.
    I don't fully understand your problem<snip/>
    do you mean
    it drops all edits you have done?Yes, it drops all the edits except the one currently being "edited" (that is, the selected editable cell will not lose it's value).
    I had a problem about it dropping the edits I had
    done and I resolved them by adding key listeners
    and played with the TableCellEditor.Could you elaborate on what you did to the TableCellEditor and which object you had listening to the keys (the table? or the tree? or something else?).
    You help is greatly appreciated!
    Brion Swanson

  • Editing in Tree....

    Hi group,
    In my tree I am setting in setCellRenderer method like
    mytree.setCellRenderer(new CellRend());
    In CellRend class:which extends DefaultTreeCellRenderer.
    in that getTreeCellRendererComponent()... I write like..
    public java.awt.Component getTreeCellRendererComponent(
         javax.swing.JTree tree,
         Object value,
         boolean sel,
         boolean expanded,
         boolean leaf,
         int w,
         boolean hasFocus) {
         setOpenIcon(new ImageIcon("open.gif"));
         setClosedIcon(new ImageIcon("closed.jpg"));
         java.awt.Component compo = super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, w, hasFocus);
         javax.swing.tree.DefaultMutableTreeNode node = (javax.swing.tree.DefaultMutableTreeNode)value;
         if(node.toString().equalsIgnoreCase("House"))
              tree.setEditable(false);
         else
              tree.setEditable(true);
         return compo;
    in my tree I have "House" node out of 10 nodes.
    I don't want to edit that particular "House" node.
    But as per my code it is editing why?
    Is any possible solution not to edit that "House" node.?
    Shalinipriya.

    if you call tree.setEditable(true) (or false) this changes the editing option for the entire tree, not just the current node. And the tree cell renderer gets called for all the nodes... So here's what is happening in your code:
    Let us assume that node 7 is your "House" node...
    The tree starts to render the nodes... it calls getTreeCellRendererComponent() for nodes 1 to 6, and each time, the expression (node.toString().equalsIgnoreCase("House")) is false, so it does: tree.setEditable(true). OK - now it gets to node 7, and (node.toString().equalsIgnoreCase("House")) is now true, so it does tree.setEditable(false) - making the entire tree not editable. Finally, it renders nodes 8, 9 & 10, where (node.toString().equalsIgnoreCase("House")) is false again, so it does: tree.setEditable(true), so when it has finished rendering, the entire tree is editable.
    That's why it doesn't work. Now, I don't know if you can directlly make only one single node editable or not editable (unless someone else knows different??) One workaround would be to add a listener, and if the user tries to edit your House node, pop up a message telling them not to, or just silently change its value back to House after they have finished (That'll frustrate the hell out of 'em ;-)

  • Start Editing an Tree-Node programmatically

    Hello there!
    I have a JTree which the user can edit by clicking on the nodes three times. This I did setting "tree.setEditable(true);". Now i want a selected node to switch to editing-mode when the user clicks on a menu.
    So how can I programmatically start editing?
    Thanks a lot, DreamiX.

    JTree has method
    startEditingAtPath(TreePath path)
    best regards
    Stas

Maybe you are looking for

  • White balance for infrared images

    Hello there, I love making infrared photos with my digital camera (Canon dSRL). When I take an IR shot, I usually set the custom white balance inside the camera, so that false colours appear correctly. If I open the CR2 RAW file using the software pr

  • Photo problems using "copy selected albums only"

    No one seems to be able to help me at Apple to figure out why if I have PhotoShop Album 2.0 that I can't get the IPod to let me have the choice of "copy selected albums only". The only choice it allows is to copy all photos and I don't want to do tha

  • Access Based Enumeration not working Windows 2012 R2 Datacenter

    I am having a hard time figuring out why Access Based Enumeration is not working for me.  I have set and re-set the settings and I'm still able to see folders I should not. I do get denied access on folders I don't have access to.  I have checked eff

  • Past App Purchases

    I spent over $100 on apps.. and then my iTouch got stolen right from my house. And also my computer crashed.. so either way, I lost all of my apps. I have an iPhone now, but when I try to download the apps I've already purchased, it doesn't give me t

  • Download a website from a given URL

    hai my task is "download a website from a given URL ,it must download all the pages from that website. it should take the depth of retrial from the user input.all the files/pages must be stored in a folder" how is it possible to download entire websi