Drag andn Drop facility in af:tree in ADF Faces

Hi,
I am exploring on the possibilities to get drag and drop feature working in an ADF Faces Tree element. Basically, I want to drag the nodes in the tree under other nodes within the same tree.
I tried using some Javascript libraries to achieve the same.
http://ajaxpatterns.org/Drag-And-Drop#In_A_Blink
But it seems that ADF Faces generate the "Id" of the nodes of the tree by prepending some string like "_id1:" to the ID provided in the Property Inspector for the node stamp of the tree element. So, we cannot use those libraries either which rely on the node id of the elements.
Does ADF Faces plan to introduce this drag and drop feature in the af:tree element.
Any help will be highy useful.
Thanks,
Ankit Goel

Hi Frank,
Can we know as to when ADF is planning to bring the drag and drop feature in ADF Tree component. Also, we would want to get a handle to the node ids of the tree. We need this to implement some right click features on the tree nodes. Is this also considered in the new UI features project.
Can we know of any page where all new upcoming features are listed, or we can request for any desired UI features. Please help.
Thanks,
Ankit

Similar Messages

  • Drag And Drop in ALV Column Tree

    Hello All,
    Can anyone tell me the method used for  a drag and drop in a column tree....
    i found it for a simple tree but not for a column tree.....
    thanks in advance....
    Regards,
    Praveen

    Check the links -
    drag drop required for alv column!
    drag and drop in a tree
    Drag&Drop within the Tree
    Drag&Drop within a tree
    Drag and drop in ALV tree
    Regards,
    Amit
    Reward all helpful replies.

  • Drag n Drop Facility in xMII 12.0

    Dear All
    Is there any way to put a drag and drop facility to user,so that he/she can able to change the colum/view according.
    Suppose,user wants to see production on a date,prod area,Prod People etc,instead of creating 3/4 transaction ,is it possible in one transaction with drag/drop facility.
    Buiplab

    I assume you are referring to rearranging iGrid columns?  In MII 12.1 AllowColumnReordering was added to the iGrid, but this does not apply to 12.0.
    DisplayColumns is the property name that controls the view, so providing the user with a simple javascript mechanism to set this property would not be too hard.
    document.APPLET.getGridObject().setDisplayColumns("A,B,C");
    document.APPLET.updateGrid(false);

  • Drag and Drop between two ALV Tree.

    Hi,
    I am trying the drag and drop event between two ALV Tree.
    After the occurence of drag and drop event , I am able to get the node key of the source tree node which is dragged . But when the node is dropped onto the target ALV Tree the target node does not gets selected, instead a plus mark appears focussing on the target node in the target ALV Tree. Can anyone suggest a way to get the node key of the focussed target node. Thanks.
    Regards,
    Prabaharan

    hey Prabaharan,
    y don't u check this link once
    u may get some idea
    Re: ALV tree - change node text
    Regards
    Naveen

  • Drag and Drop between the Two Tree controls

    Hi all,
    I am Flex newbie. Can anyone please send me the drag and drop
    example between the Two Tree controls.
    Thank you
    -Nagaraju

    "ndendukuri" <[email protected]> wrote in
    message
    news:gdnbtt$7tt$[email protected]..
    > Hi all,
    >
    > I am Flex newbie. Can anyone please send me the drag and
    drop example
    > between the Two Tree controls.
    >
    http://flexdiary.blogspot.com/2008/07/getting-help-in-flex-builder.html

  • Drag and Drop between two ALV Tree Controls

    Hello all,
    I have designed a spilt control of two ALV Trees using CL_GUI_ALV_TREE.
    I have a top node as the Sales order Number and the child node as the items belonging to that sales order number.
    Now i need to drag and drop the lines from one sales order to another.
    Also these drag drop can take place between the nodes of the two different trees.
    Can someone provide with a detail example as i need to complete the same urgently.
    Regards,
    Arun

    Once check the Below code For tree to tree drag an drop
    *       CLASS lcl_main DEFINITION
    CLASS lcl_main  DEFINITION.
      PUBLIC SECTION.
    * Types
        TYPES:
                BEGIN OF  t_ekpo,
                  ebeln TYPE ebeln,
                  ebelp TYPE ebelp,
                END OF    t_ekpo.
        TYPES:
                BEGIN OF  t_vbap,
                  vbeln TYPE vbeln,
                  posnr TYPE vbelp,
                END OF    t_vbap.
    * Internal Tables
        DATA:
              i_ekpo        TYPE STANDARD TABLE OF t_ekpo,
              i_ekpo_op     TYPE STANDARD TABLE OF t_ekpo,
              i_vbap        TYPE STANDARD TABLE OF t_vbap,
              i_vbap_op     TYPE STANDARD TABLE OF t_vbap,
              i_fcat_ekpo   TYPE                   lvc_t_fcat,
              i_fcat_vbap   TYPE                   lvc_t_fcat.
    * Work Areas
        DATA:
              wa_ekpo   TYPE t_ekpo,
              wa_ekpo1  TYPE t_ekpo,
              wa_vbap   TYPE t_vbap,
              wa_vbap1  TYPE t_vbap.
    * Data Declarations
        DATA:
              g_ebeln TYPE ebeln,
              g_vbeln TYPE vbeln_va.
        DATA: g_variant          TYPE disvariant,
              g_hierarchy_header TYPE treev_hhdr,
              g_handle_drag      TYPE i,
              g_handle_drop      TYPE i.
    * Class data
        DATA:
              splitter    TYPE REF TO cl_gui_splitter_container,
              container   TYPE REF TO cl_gui_custom_container,
              container_1 TYPE REF TO cl_gui_container,
              container_2 TYPE REF TO cl_gui_container,
              tree1       TYPE REF TO cl_gui_alv_tree,
              tree2       TYPE REF TO cl_gui_alv_tree,
              g_drag      TYPE REF TO cl_dragdrop,
              g_drop      TYPE REF TO cl_dragdrop.
    * Constants
        CONSTANTS:
                  c_30(2) TYPE c VALUE '30'.
    * Methods
        METHODS:
                  get_data,                          " Data Fatch
                  build_display,                     " Display Container
                  display_ekpo,                      " Ekpo table display
                  display_vbap,                      " Vbap table display
                  add_node_ekpo                      " Add node to Ekpo
                    IMPORTING table  TYPE t_ekpo
                              key    TYPE lvc_nkey
                              text   TYPE lvc_value
                              flag   TYPE c
                    CHANGING  i_key  TYPE lvc_nkey,
                  add_node_vbap                      " Add node to vbap
                    IMPORTING table  TYPE t_vbap
                              key    TYPE lvc_nkey
                              text   TYPE lvc_value
                              flag   TYPE c
                    CHANGING  i_key  TYPE lvc_nkey,
                  dnd_behaviour,                     " Drag and drop behavour
                  register_events_ekpo,              " Register Events Ekpo
                  register_events_vbap,              " Register events vbap
                  handle_drag_multiple               " Drag Multiple Values
                     FOR EVENT on_drag_multiple
                     OF cl_gui_alv_tree
                     IMPORTING sender node_key_table fieldname drag_drop_object,
                  handle_drop                        " Drop the values
                     FOR EVENT on_drop
                     OF cl_gui_alv_tree
                     IMPORTING sender node_key drag_drop_object,
                  add_node_drop                      " Add node to Drop Node
                    IMPORTING table  TYPE t_ekpo
                              key    TYPE lvc_nkey
                              text   TYPE lvc_value
                    CHANGING  i_key  TYPE lvc_nkey.
    ENDCLASS.                                        " Lcl_main DEFINITION
    *       CLASS LCL_DRAGOBJ DEFINITION
    * Drag And drop Structure
    CLASS lcl_dragobj DEFINITION INHERITING FROM lcl_main FINAL.
      PUBLIC SECTION.
    * Types
        TYPES: BEGIN OF t_node_info,
                  l_ekpo      TYPE t_ekpo,
                  l_node_text TYPE lvc_value,
                  l_node_key  TYPE lvc_nkey,
               END OF t_node_info.
    * Data
        DATA: i_node_info  TYPE TABLE OF t_node_info,
              wa_node_info TYPE t_node_info.
    ENDCLASS.                                        " LCL_DRAGOBJ DEFINITION
    * Object Declarations
    DATA  obj_main  TYPE REF TO lcl_main.
    * Initialization                                                     *
    INITIALIZATION.
      CREATE OBJECT obj_main.
    * Selection Screen                                                   *
      SELECTION-SCREEN  BEGIN OF BLOCK  block1  WITH FRAME.
      SELECT-OPTIONS:
                      s_ebeln FOR obj_main->g_ebeln,
                      s_vbeln FOR obj_main->g_vbeln MATCHCODE OBJECT  cs_vbeln.
      SELECTION-SCREEN  END OF   BLOCK  block1.
    * Start of Selection                                                 *
    START-OF-SELECTION.
    * Call Screen
      CALL SCREEN 100.
    *       CLASS lcl_main IMPLEMENTATION
    * Local class Implementation
    CLASS lcl_main  IMPLEMENTATION.
    * Get Data                                                           *
      METHOD  get_data.
    * Data from Ekpo
        SELECT  ebeln
                ebelp
          FROM  ekpo
          UP TO 100 ROWS
          INTO  TABLE i_ekpo
         WHERE  ebeln IN  s_ebeln.
    * Data from Vbap
        SELECT  vbeln
                posnr
          FROM  vbap
          UP TO 100 ROWS
          INTO  TABLE i_vbap
         WHERE  vbeln IN  s_vbeln.
      ENDMETHOD.                                     " Get_data
    * Build Display                                                      *
      METHOD  build_display.
    * Create Container
        CREATE OBJECT container
          EXPORTING
            container_name = 'CUST_CONT'.
    * Split the container
        CREATE OBJECT splitter
          EXPORTING
            parent  = container
            rows    = 1
            columns = 2.
        CALL METHOD splitter->get_container
          EXPORTING
            row       = 1
            column    = 1
          RECEIVING
            container = container_1.
        CALL METHOD splitter->get_container
          EXPORTING
            row       = 1
            column    = 2
          RECEIVING
            container = container_2.
    * create tree control
        CREATE OBJECT tree1
          EXPORTING
            parent                      = container_1
            node_selection_mode         = cl_gui_column_tree=>node_sel_mode_multiple
            item_selection              = 'X'
            no_html_header              = 'X'
            no_toolbar                  = 'X'
          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 NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0.
        CREATE OBJECT tree2
          EXPORTING
            parent                      = container_2
            node_selection_mode         = cl_gui_column_tree=>node_sel_mode_multiple
            item_selection              = 'X'
            no_html_header              = 'X'
            no_toolbar                  = 'X'
          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 NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0.
        g_variant-report      = sy-repid.
        g_variant-handle      = space.
        g_variant-log_group   = space.
        g_variant-username    = space.
        g_variant-text        = space.
        g_variant-dependvars  = space.
    * Call method for get data
        CALL METHOD get_data.
    * Drap And Drop behaviour method
        CALL METHOD dnd_behaviour.
    * Display the Ekpo table
        CALL METHOD obj_main->display_ekpo.
    * Diaplay the vbap table
        CALL METHOD obj_main->display_vbap.
        CALL METHOD tree1->frontend_update.
        CALL METHOD tree2->frontend_update.
      ENDMETHOD.                                     " Build_display
    * Display EKPO                                                       *
      METHOD  display_ekpo.
    * Data
        DATA:
              l_key1 TYPE lvc_nkey,
              l_key2 TYPE lvc_nkey,
              l_key3 TYPE lvc_nkey,
              l_node_text TYPE lvc_value.
    * ALV control service modules
        CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
          EXPORTING
            i_buffer_active        = 'X'
            i_structure_name       = 'EKPO'
            i_client_never_display = 'X'
            i_bypassing_buffer     = space
          CHANGING
            ct_fieldcat            = i_fcat_ekpo
          EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
        IF sy-subrc EQ 0.
          DELETE i_fcat_ekpo FROM 4.
        ENDIF.                                       " IF sy-subrc EQ 0.
        g_hierarchy_header-heading = 'Purchase Order Details'(001).
        g_hierarchy_header-tooltip = 'Purchase Order'(002).
        g_hierarchy_header-width = c_30.
        g_hierarchy_header-width_pix = ' '.
    * Diaply
        CALL METHOD tree1->set_table_for_first_display
          EXPORTING
            is_hierarchy_header = g_hierarchy_header
            is_variant          = g_variant
          CHANGING
            it_outtab           = obj_main->i_ekpo_op
            it_fieldcatalog     = i_fcat_ekpo.
        LOOP AT i_ekpo  INTO  wa_ekpo1.
          MOVE wa_ekpo1 TO wa_ekpo.
          l_key1  = ''.
          AT NEW  ebeln.
            MOVE wa_ekpo-ebeln  TO l_node_text.
    * Call method for Add Node to Ekpo
            CALL METHOD add_node_ekpo
              EXPORTING
                table = wa_ekpo
                key   = l_key1
                text  = l_node_text
                flag  = space
              CHANGING
                i_key = l_key2.
          ENDAT.
          CLEAR l_node_text.
          MOVE wa_ekpo-ebelp  TO l_node_text.
    * Call method for Add Node to Ekpo
          CALL METHOD add_node_ekpo
            EXPORTING
              table = wa_ekpo
              key   = l_key2
              text  = l_node_text
              flag  = 'X'
            CHANGING
              i_key = l_key3.
        ENDLOOP.                                     " LOOP AT i_ekpo  INTO  wa_ekpo1.
    * Call method For Register events
        CALL METHOD register_events_ekpo.
      ENDMETHOD.                                     " Display_ekpo
    * Display VBAP                                                       *
      METHOD  display_vbap.
    *  Data
        DATA:
           l_key1 TYPE lvc_nkey,
           l_key2 TYPE lvc_nkey,
           l_key3 TYPE lvc_nkey,
           l_node_text TYPE lvc_value.
        REFRESH i_fcat_vbap.
    * ALV control service modules
        CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
          EXPORTING
            i_buffer_active        = 'X'
            i_structure_name       = 'VBAP'
            i_client_never_display = 'X'
            i_bypassing_buffer     = space
          CHANGING
            ct_fieldcat            = i_fcat_vbap
          EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
        IF sy-subrc EQ 0.
          DELETE i_fcat_vbap FROM 4.
        ENDIF.                                       " IF sy-subrc EQ 0.
        g_hierarchy_header-heading = 'Sales Order Details'(003).
        g_hierarchy_header-tooltip = 'Sales Order'(004).
        g_hierarchy_header-width = c_30.
        g_hierarchy_header-width_pix = ' '.
    * Display
        CALL METHOD tree2->set_table_for_first_display
          EXPORTING
            is_hierarchy_header = g_hierarchy_header
            is_variant          = g_variant
          CHANGING
            it_outtab           = obj_main->i_vbap_op
            it_fieldcatalog     = i_fcat_vbap.
        LOOP AT i_vbap  INTO  wa_vbap1.
          MOVE wa_vbap1 TO wa_vbap.
          l_key1  = ''.
          AT NEW  vbeln.
            MOVE wa_vbap-vbeln  TO l_node_text.
    * Call method for Add Node to vbap
            CALL METHOD add_node_vbap
              EXPORTING
                table = wa_vbap
                key   = l_key1
                text  = l_node_text
                flag  = 'X'
              CHANGING
                i_key = l_key2.
          ENDAT.
          CLEAR l_node_text.
          MOVE wa_vbap-posnr  TO l_node_text.
    * Call method for Add Node to vbap
          CALL METHOD add_node_vbap
            EXPORTING
              table = wa_vbap
              key   = l_key2
              text  = l_node_text
              flag  = space
            CHANGING
              i_key = l_key3.
        ENDLOOP.                                     " LOOP AT i_vbap  INTO  wa_vbap1.
    * Call method For Register events
        CALL METHOD register_events_vbap.
      ENDMETHOD.                                     " Display_vbap
    * Add Node to Ekko                                                   *
      METHOD  add_node_ekpo.
    * Data
        DATA: l_layout_node TYPE lvc_s_layn.
        IF flag = 'X'.
          l_layout_node-dragdropid = g_handle_drag.
        ENDIF.                                       " IF flag = 'X'.
    *   Add node to tree1
        CALL METHOD tree1->add_node
          EXPORTING
            i_relat_node_key     = key
            i_relationship       = cl_gui_column_tree=>relat_last_child
            is_outtab_line       = table
            i_node_text          = text
            is_node_layout       = l_layout_node
          IMPORTING
            e_new_node_key       = i_key
          EXCEPTIONS
            relat_node_not_found = 1
            node_not_found       = 2
            OTHERS               = 3.
        IF sy-subrc NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0.
      ENDMETHOD.                                     " Add_node_ekpo
    * Add Node to Vbap                                                   *
      METHOD  add_node_vbap.
    * Data
        DATA: l_layout_node TYPE lvc_s_layn.
        IF flag = 'X'.
          l_layout_node-dragdropid = g_handle_drop.
        ENDIF.                                       " IF flag = 'X'.
    * Add node for tree2
        CALL METHOD tree2->add_node
          EXPORTING
            i_relat_node_key     = key
            i_relationship       = cl_gui_column_tree=>relat_last_child
            is_outtab_line       = table
            i_node_text          = text
            is_node_layout       = l_layout_node
          IMPORTING
            e_new_node_key       = i_key
          EXCEPTIONS
            relat_node_not_found = 1
            node_not_found       = 2
            OTHERS               = 3.
        IF sy-subrc NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0.
      ENDMETHOD.                                     " Add_node_vbap
    * Dnd behaviour                                                      *
      METHOD  dnd_behaviour.
    * Data
        DATA: effect TYPE i,
              l_flavor TYPE c VALUE 'f'.
    * For drag
        CREATE OBJECT g_drag.
        effect = cl_dragdrop=>copy.
        CALL METHOD g_drag->add
          EXPORTING
            flavor         = l_flavor
            dragsrc        = 'X'
            droptarget     = ' '
            effect         = effect
            effect_in_ctrl = effect.
        CALL METHOD g_drag->get_handle
          IMPORTING
            handle = g_handle_drag.
    * For Drop
        CREATE OBJECT g_drop.
        effect = cl_dragdrop=>copy.
        CALL METHOD g_drop->add
          EXPORTING
            flavor         = l_flavor
            dragsrc        = ' '
            droptarget     = 'X'
            effect         = effect
            effect_in_ctrl = effect.
        CALL METHOD g_drop->get_handle
          IMPORTING
            handle = g_handle_drop.
      ENDMETHOD.                                     " Dnd_behaviour
    * register events                                                    *
      METHOD  register_events_ekpo.
    * Data
        DATA: lt_events TYPE cntl_simple_events.
    * Tree events registers ALV Tree
        CALL METHOD tree1->get_registered_events
          IMPORTING
            events = lt_events.
    * Register events on frontend
        CALL METHOD tree1->set_registered_events
          EXPORTING
            events                    = lt_events
          EXCEPTIONS
            cntl_error                = 1
            cntl_system_error         = 2
            illegal_event_combination = 3.
        IF sy-subrc NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0.
    * Event Handling
        SET HANDLER obj_main->handle_drag_multiple FOR tree1.
      ENDMETHOD.                                     " Register_events_ekpo
    * register events                                                    *
      METHOD  register_events_vbap.
    * Data
        DATA: lt_events TYPE cntl_simple_events.
    * Tree events registers ALV Tree
        CALL METHOD tree2->get_registered_events
          IMPORTING
            events = lt_events.
    * Register events on frontend
        CALL METHOD tree2->set_registered_events
          EXPORTING
            events                    = lt_events
          EXCEPTIONS
            cntl_error                = 1
            cntl_system_error         = 2
            illegal_event_combination = 3.
        IF sy-subrc NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0.
    * Event
        SET HANDLER obj_main->handle_drop FOR tree2.
      ENDMETHOD.                                     " Register_events_vbap
    * Handle drag multiple Values                                        *
      METHOD handle_drag_multiple.
    * Data
        DATA: dataobj       TYPE REF TO lcl_dragobj,
              l_node_key    TYPE lvc_nkey,
              l_ekpo        TYPE t_ekpo,
              l_node_text   TYPE lvc_value,
              l_node_layout TYPE lvc_s_layn.
    * Create and fill dataobject for event ON_DROP.
        CREATE OBJECT dataobj.
    * Loop the Node key Table
        LOOP AT node_key_table INTO l_node_key.
          CALL METHOD sender->get_outtab_line
            EXPORTING
              i_node_key     = l_node_key
            IMPORTING
              e_outtab_line  = l_ekpo
              e_node_text    = l_node_text
              es_node_layout = l_node_layout.
          IF l_node_layout-isfolder NE 'X'.
            dataobj->wa_node_info-l_node_key  = l_node_key.
            dataobj->wa_node_info-l_ekpo      = l_ekpo.
            dataobj->wa_node_info-l_node_text = l_node_text.
            APPEND dataobj->wa_node_info TO dataobj->i_node_info.
          ENDIF.                                     " IF l_node_layout-isfolder NE 'X'.
        ENDLOOP.                                     " LOOP AT node_key_table INTO l_node_key
        drag_drop_object->object = dataobj.
      ENDMETHOD.                                     " Handle_drag_multiple
    * Handle drop multiple Values                                        *
      METHOD handle_drop.
        DATA: dataobj TYPE REF TO lcl_dragobj,
              l_new_key TYPE lvc_nkey,
              l_node_text TYPE lvc_value.
        CATCH SYSTEM-EXCEPTIONS move_cast_error = 1.
    * ON_DROP
          dataobj ?= drag_drop_object->object.
          LOOP AT dataobj->i_node_info INTO dataobj->wa_node_info.
            MOVE dataobj->wa_node_info-l_node_text  TO l_node_text.
    * Call method for Add Node to vbap
            CALL METHOD add_node_drop
              EXPORTING
                table = dataobj->wa_node_info-l_ekpo
                key   = node_key
                text  = l_node_text
              CHANGING
                i_key = l_new_key.
          ENDLOOP.                                   " LOOP AT dataobj->i_node_info INTO dataobj->wa_node_inf
    * Expand the node
          CALL METHOD sender->expand_node
            EXPORTING
              i_node_key = node_key
          CALL METHOD sender->frontend_update.
        ENDCATCH.
        IF sy-subrc NE 0.
          CALL METHOD drag_drop_object->abort.
        ENDIF.                                       " IF sy-subrc NE 0
      ENDMETHOD.                                     " Handle_drop
    * Add Node to drop                                                   *
      METHOD  add_node_drop.
    * Add node to drop tree
        CALL METHOD tree2->add_node
          EXPORTING
            i_relat_node_key     = key
            i_relationship       = cl_gui_column_tree=>relat_last_child
            is_outtab_line       = table
            i_node_text          = text
    *       is_node_layout       = l_layout_node
          IMPORTING
            e_new_node_key       = i_key
          EXCEPTIONS
            relat_node_not_found = 1
            node_not_found       = 2
            OTHERS               = 3.
        IF sy-subrc NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0
      ENDMETHOD.                                     " Add_node_drop
    ENDCLASS.                                        " lcl_main IMPLEMENTATION
    *&      Module  STATUS_0100  OUTPUT
    *  Screen 100 Pbo
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'BACK'.
    *  SET TITLEBAR 'xxx'.
      CALL METHOD obj_main->build_display.
    ENDMODULE.                                       " Status_0100 OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *  Screen 100 Pai
    MODULE user_command_0100 INPUT.
      IF sy-ucomm EQ 'BACK'.
        LEAVE TO SCREEN 0.
      ENDIF.                                         " IF sy-ucomm EQ 'BACK'
    ENDMODULE.                                       " USER_COMMAND_0100  INPUT
    *& Report  ZBPS_TREE_DRAG_DROP
    REPORT  zbps_tree_drag_drop.
    *       CLASS lcl_main DEFINITION
    CLASS lcl_main  DEFINITION.
      PUBLIC SECTION.
    * Types
        TYPES:
                BEGIN OF  t_ekpo,
                  ebeln TYPE ebeln,
                  ebelp TYPE ebelp,
                END OF    t_ekpo.
        TYPES:
                BEGIN OF  t_vbap,
                  vbeln TYPE vbeln,
                  posnr TYPE vbelp,
                END OF    t_vbap.
    * Internal Tables
        DATA:
              i_ekpo        TYPE STANDARD TABLE OF t_ekpo,
              i_ekpo_op     TYPE STANDARD TABLE OF t_ekpo,
              i_vbap        TYPE STANDARD TABLE OF t_vbap,
              i_vbap_op     TYPE STANDARD TABLE OF t_vbap,
              i_fcat_ekpo   TYPE                   lvc_t_fcat,
              i_fcat_vbap   TYPE                   lvc_t_fcat.
    * Work Areas
        DATA:
              wa_ekpo   TYPE t_ekpo,
              wa_ekpo1  TYPE t_ekpo,
              wa_vbap   TYPE t_vbap,
              wa_vbap1  TYPE t_vbap.
    * Data Declarations
        DATA:
              g_ebeln TYPE ebeln,
              g_vbeln TYPE vbeln_va.
        DATA: g_variant          TYPE disvariant,
              g_hierarchy_header TYPE treev_hhdr,
              g_handle_drag      TYPE i,
              g_handle_drop      TYPE i.
    * Class data
        DATA:
              splitter    TYPE REF TO cl_gui_splitter_container,
              container   TYPE REF TO cl_gui_custom_container,
              container_1 TYPE REF TO cl_gui_container,
              container_2 TYPE REF TO cl_gui_container,
              tree1       TYPE REF TO cl_gui_alv_tree,
              tree2       TYPE REF TO cl_gui_alv_tree,
              g_drag      TYPE REF TO cl_dragdrop,
              g_drop      TYPE REF TO cl_dragdrop.
    * Constants
        CONSTANTS:
                  c_30(2) TYPE c VALUE '30'.
    * Methods
        METHODS:
                  get_data,                          " Data Fatch
                  build_display,                     " Display Container
                  display_ekpo,                      " Ekpo table display
                  display_vbap,                      " Vbap table display
                  add_node_ekpo                      " Add node to Ekpo
                    IMPORTING table  TYPE t_ekpo
                              key    TYPE lvc_nkey
                              text   TYPE lvc_value
                              flag   TYPE c
                    CHANGING  i_key  TYPE lvc_nkey,
                  add_node_vbap                      " Add node to vbap
                    IMPORTING table  TYPE t_vbap
                              key    TYPE lvc_nkey
                              text   TYPE lvc_value
                              flag   TYPE c
                    CHANGING  i_key  TYPE lvc_nkey,
                  dnd_behaviour,                     " Drag and drop behavour
                  register_events_ekpo,              " Register Events Ekpo
                  register_events_vbap,              " Register events vbap
                  handle_drag_multiple               " Drag Multiple Values
                     FOR EVENT on_drag_multiple
                     OF cl_gui_alv_tree
                     IMPORTING sender node_key_table fieldname drag_drop_object,
                  handle_drop                        " Drop the values
                     FOR EVENT on_drop
                     OF cl_gui_alv_tree
                     IMPORTING sender node_key drag_drop_object,
                  add_node_drop                      " Add node to Drop Node
                    IMPORTING table  TYPE t_ekpo
                              key    TYPE lvc_nkey
                              text   TYPE lvc_value
                    CHANGING  i_key  TYPE lvc_nkey.
    ENDCLASS.                                        " Lcl_main DEFINITION
    *       CLASS LCL_DRAGOBJ DEFINITION
    * Drag And drop Structure
    CLASS lcl_dragobj DEFINITION INHERITING FROM lcl_main FINAL.
      PUBLIC SECTION.
    * Types
        TYPES: BEGIN OF t_node_info,
                  l_ekpo      TYPE t_ekpo,
                  l_node_text TYPE lvc_value,
                  l_node_key  TYPE lvc_nkey,
               END OF t_node_info.
    * Data
        DATA: i_node_info  TYPE TABLE OF t_node_info,
              wa_node_info TYPE t_node_info.
    ENDCLASS.                                        " LCL_DRAGOBJ DEFINITION
    * Object Declarations
    DATA  obj_main  TYPE REF TO lcl_main.
    * Initialization                                                     *
    INITIALIZATION.
      CREATE OBJECT obj_main.
    * Selection Screen                                                   *
      SELECTION-SCREEN  BEGIN OF BLOCK  block1  WITH FRAME.
      SELECT-OPTIONS:
                      s_ebeln FOR obj_main->g_ebeln,
                      s_vbeln FOR obj_main->g_vbeln MATCHCODE OBJECT  cs_vbeln.
      SELECTION-SCREEN  END OF   BLOCK  block1.
    * Start of Selection                                                 *
    START-OF-SELECTION.
    * Call Screen
      CALL SCREEN 100.
    *       CLASS lcl_main IMPLEMENTATION
    * Local class Implementation
    CLASS lcl_main  IMPLEMENTATION.
    * Get Data                                                           *
      METHOD  get_data.
    * Data from Ekpo
        SELECT  ebeln
                ebelp
          FROM  ekpo
          UP TO 100 ROWS
          INTO  TABLE i_ekpo
         WHERE  ebeln IN  s_ebeln.
    * Data from Vbap
        SELECT  vbeln
                posnr
          FROM  vbap
          UP TO 100 ROWS
          INTO  TABLE i_vbap
         WHERE  vbeln IN  s_vbeln.
      ENDMETHOD.                                     " Get_data
    * Build Display                                                      *
      METHOD  build_display.
    * Create Container
        CREATE OBJECT container
          EXPORTING
            container_name = 'CUST_CONT'.
    * Split the container
        CREATE OBJECT splitter
          EXPORTING
            parent  = container
            rows    = 1
            columns = 2.
        CALL METHOD splitter->get_container
          EXPORTING
            row       = 1
            column    = 1
          RECEIVING
            container = container_1.
        CALL METHOD splitter->get_container
          EXPORTING
            row       = 1
            column    = 2
          RECEIVING
            container = container_2.
    * create tree control
        CREATE OBJECT tree1
          EXPORTING
            parent                      = container_1
            node_selection_mode         = cl_gui_column_tree=>node_sel_mode_multiple
            item_selection              = 'X'
            no_html_header              = 'X'
            no_toolbar                  = 'X'
          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 NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0.
        CREATE OBJECT tree2
          EXPORTING
            parent                      = container_2
            node_selection_mode         = cl_gui_column_tree=>node_sel_mode_multiple
            item_selection              = 'X'
            no_html_header              = 'X'
            no_toolbar                  = 'X'
          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 NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0.
        g_variant-report      = sy-repid.
        g_variant-handle      = space.
        g_variant-log_group   = space.
        g_variant-username    = space.
        g_variant-text        = space.
        g_variant-dependvars  = space.
    * Call method for get data
        CALL METHOD get_data.
    * Drap And Drop behaviour method
        CALL METHOD dnd_behaviour.
    * Display the Ekpo table
        CALL METHOD obj_main->display_ekpo.
    * Diaplay the vbap table
        CALL METHOD obj_main->display_vbap.
        CALL METHOD tree1->frontend_update.
        CALL METHOD tree2->frontend_update.
      ENDMETHOD.                                     " Build_display
    * Display EKPO                                                       *
      METHOD  display_ekpo.
    * Data
        DATA:
              l_key1 TYPE lvc_nkey,
              l_key2 TYPE lvc_nkey,
              l_key3 TYPE lvc_nkey,
              l_node_text TYPE lvc_value.
    * ALV control service modules
        CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
          EXPORTING
            i_buffer_active        = 'X'
            i_structure_name       = 'EKPO'
            i_client_never_display = 'X'
            i_bypassing_buffer     = space
          CHANGING
            ct_fieldcat            = i_fcat_ekpo
          EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
        IF sy-subrc EQ 0.
          DELETE i_fcat_ekpo FROM 4.
        ENDIF.                                       " IF sy-subrc EQ 0.
        g_hierarchy_header-heading = 'Purchase Order Details'(001).
        g_hierarchy_header-tooltip = 'Purchase Order'(002).
        g_hierarchy_header-width = c_30.
        g_hierarchy_header-width_pix = ' '.
    * Diaply
        CALL METHOD tree1->set_table_for_first_display
          EXPORTING
            is_hierarchy_header = g_hierarchy_header
            is_variant          = g_variant
          CHANGING
            it_outtab           = obj_main->i_ekpo_op
            it_fieldcatalog     = i_fcat_ekpo.
        LOOP AT i_ekpo  INTO  wa_ekpo1.
          MOVE wa_ekpo1 TO wa_ekpo.
          l_key1  = ''.
          AT NEW  ebeln.
            MOVE wa_ekpo-ebeln  TO l_node_text.
    * Call method for Add Node to Ekpo
            CALL METHOD add_node_ekpo
              EXPORTING
                table = wa_ekpo
                key   = l_key1
                text  = l_node_text
                flag  = space
              CHANGING
                i_key = l_key2.
          ENDAT.
          CLEAR l_node_text.
          MOVE wa_ekpo-ebelp  TO l_node_text.
    * Call method for Add Node to Ekpo
          CALL METHOD add_node_ekpo
            EXPORTING
              table = wa_ekpo
              key   = l_key2
              text  = l_node_text
              flag  = 'X'
            CHANGING
              i_key = l_key3.
        ENDLOOP.                                     " LOOP AT i_ekpo  INTO  wa_ekpo1.
    * Call method For Register events
        CALL METHOD register_events_ekpo.
      ENDMETHOD.                                     " Display_ekpo
    * Display VBAP                                                       *
      METHOD  display_vbap.
    *  Data
        DATA:
           l_key1 TYPE lvc_nkey,
           l_key2 TYPE lvc_nkey,
           l_key3 TYPE lvc_nkey,
           l_node_text TYPE lvc_value.
        REFRESH i_fcat_vbap.
    * ALV control service modules
        CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
          EXPORTING
            i_buffer_active        = 'X'
            i_structure_name       = 'VBAP'
            i_client_never_display = 'X'
            i_bypassing_buffer     = space
          CHANGING
            ct_fieldcat            = i_fcat_vbap
          EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
        IF sy-subrc EQ 0.
          DELETE i_fcat_vbap FROM 4.
        ENDIF.                                       " IF sy-subrc EQ 0.
        g_hierarchy_header-heading = 'Sales Order Details'(003).
        g_hierarchy_header-tooltip = 'Sales Order'(004).
        g_hierarchy_header-width = c_30.
        g_hierarchy_header-width_pix = ' '.
    * Display
        CALL METHOD tree2->set_table_for_first_display
          EXPORTING
            is_hierarchy_header = g_hierarchy_header
            is_variant          = g_variant
          CHANGING
            it_outtab           = obj_main->i_vbap_op
            it_fieldcatalog     = i_fcat_vbap.
        LOOP AT i_vbap  INTO  wa_vbap1.
          MOVE wa_vbap1 TO wa_vbap.
          l_key1  = ''.
          AT NEW  vbeln.
            MOVE wa_vbap-vbeln  TO l_node_text.
    * Call method for Add Node to vbap
            CALL METHOD add_node_vbap
              EXPORTING
                table = wa_vbap
                key   = l_key1
                text  = l_node_text
                flag  = 'X'
              CHANGING
                i_key = l_key2.
          ENDAT.
          CLEAR l_node_text.
          MOVE wa_vbap-posnr  TO l_node_text.
    * Call method for Add Node to vbap
          CALL METHOD add_node_vbap
            EXPORTING
              table = wa_vbap
              key   = l_key2
              text  = l_node_text
              flag  = space
            CHANGING
              i_key = l_key3.
        ENDLOOP.                                     " LOOP AT i_vbap  INTO  wa_vbap1.
    * Call method For Register events
        CALL METHOD register_events_vbap.
      ENDMETHOD.                                     " Display_vbap
    * Add Node to Ekko                                                   *
      METHOD  add_node_ekpo.
    * Data
        DATA: l_layout_node TYPE lvc_s_layn.
        IF flag = 'X'.
          l_layout_node-dragdropid = g_handle_drag.
        ENDIF.                                       " IF flag = 'X'.
    *   Add node to tree1
        CALL METHOD tree1->add_node
          EXPORTING
            i_relat_node_key     = key
            i_relationship       = cl_gui_column_tree=>relat_last_child
            is_outtab_line       = table
            i_node_text          = text
            is_node_layout       = l_layout_node
          IMPORTING
            e_new_node_key       = i_key
          EXCEPTIONS
            relat_node_not_found = 1
            node_not_found       = 2
            OTHERS               = 3.
        IF sy-subrc NE 0.
          CLEAR sy-subrc.
        ENDIF.                                       " IF sy-subrc NE 0.
      ENDMETHOD.                                     " Add_node_ekpo
    * Add Node to Vbap                                                   *
      METHOD  add_node_vbap.
    * Data
        DATA: l_layout_node TYPE lvc_s_layn.
        IF flag = 'X'.
          l_layout_node-dragdropid = g_handle_drop.
        ENDIF.                                       " IF flag = 'X'.
    * Add node for tree2
        CALL METHOD t

  • Drag and Drop in feature in Tree UI element

    Hello All,
    The requirement is as following. The webdynpro screen should show two nodes Node1 and Node2. Each node would have some attributes.
    Node1           
    __AAA
    __BBB
    Node2
       |__XXX
       |__YYY
    It should  be possible to drag and drop attributes from node to another node(Example , cut YYY from Node2 and add it to Node1).
    Now can we achieve this using Tree UI element? Please let me know your inputs?
    Regards,
    Raghu.

    it should be possible according to sap help[http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a5/bf47414eca430794189fbb5919cc2f/content.htm|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a5/bf47414eca430794189fbb5919cc2f/content.htm]
    Edited by: Baskaran Senthivel on Jan 16, 2012 8:41 PM

  • Manual Drag and Drop from Tree to Tree with XML dataProvider

    Been struggling with Drag-n-Drop between Tree controls. As far as I can tell, it doesn't work very well.
    I have boiled it down to a minimal project below and would be ever so grateful if someone can tell me what I am doing wrong.
    The complete MXML application file is below. Flex 3.5.
    Two trees side-by-side. One has XML that I want to drag over to the drop tree.
    On the DragOver() event, I select the node which is given to me by the calculateDropIndex() function.
    After startup; first open the L1 branch on the left and drag L11 over and drop it on the right Tree.
    Looks good, root node is selected/highlighted and dropFeedback is correct and dropping the node drops it as a child of "Start Here".
    Open the Start Here root node to see it.
    Now proceded to #1 below.
    Here are the problems:
    1) Drag "L12" from the left tree over to the middle of the right tree (below "L11" just dropped). "L11" will not be selected. The Selected node (with dropIndex=4) will be the entire new nested XML "<L><L11/></L>"; and therefore only "Start Here" node will be highlighted. Drop "L12" anyway. So, it is acting like selectedIndex = <anynumber> will only select the root node. How do I get the new L11 to show as a drop target?
    2) Now drag "L21" from the left tree onto the right tree; again starting below all nodes on the right tree. Selected node will not change until you drag it above #2 out of 3. Then, you can drag it anywhere, and correctly highlight/select any node as the target, and get that node in code. This is a problem. Go ahead and drop it anywhere. Now if you drag, for example, L22 from the left it will correctly highlight/select any node without having to first drag above #2 in the list.
    3) Now, grab and drag L11 a second time and drop it at the bottom on the right. Drag L23 over. No matter which L11 you hover over, it highlights the one at the bottom. How can this be right?
    Those are the bugs I would like to figure out. If I am doing it wrong, I sure would like to know what I am doing wrong. The code below is distilled down to one simple mxml application module.
    Thanks,
    Jeff
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" minWidth="955" minHeight="600">
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection; 
    import mx.core.IUIComponent; 
    import mx.events.DragEvent; 
    import mx.managers.DragManager; 
    Bindable] 
    private var dragXML:XML = 
    <Tree label="root"><L1 label="L1">
    <L11 label="L11"/>
    <L12 label="L12"/>
    </L1>
    <L2 label="L2">
    <L21 label="L21"/>
    <L22 label="L22"/>
    <L23 label="L23"/>
    </L2>
    </Tree> ; 
    Bindable] 
    private var dragXMLListCollection:XMLListCollection = new XMLListCollection(dragXML.*); 
    Bindable] 
    private var dropXML:XML = 
    <Tree label="root"><L label="Start Here"/>
    </Tree> ; 
    Bindable] 
    private var dropXMLListCollection:XMLListCollection = new XMLListCollection(dropXML.*); 
    // ************* Drag Drop Events ********************
    private function dragEnter(evt:DragEvent):void
    if (evt.dragSource.hasFormat("treeItems")) DragManager.acceptDragDrop(IUIComponent(evt.target));}
    private function dragOver(evt:DragEvent):void
    // Calculate dropindex and set selected item
    var dropIndex:int = dropTree.calculateDropIndex(evt);dropTree.selectedIndex = dropIndex;
    // setting the selected item based on calculateDropIndex()
    var selNode:XML = dropTree.selectedItem as XML; // Getting XML for selected node in Tree
    var selNodeName:String = (selNode != null ? selNode.localName() : ""); 
    // Get dragged XML
    var dragNode:XML = XML(evt.dragSource.dataForFormat("treeItems")[0]); 
    var dragNodeName:String = dragNode.localName(); 
    trace(evt, "\n", dropIndex, "\n", (selNode ? selNode.toXMLString() : "null"), "\n", dragNode.toXMLString()); 
    // you cannot drop a shorter name on a longer name
    if ((dragNodeName.length >= selNodeName.length) && (selNode != null)) DragManager.showFeedback(DragManager.COPY); 
    else DragManager.showFeedback(DragManager.NONE);}
    private function dragDrop(evt:DragEvent):void
    // get selected node in drop tree
    var selNode:XML = dropTree.selectedItem as XML; //selected in dragOver() event
    // Get dragged XML
    var dragNode:XML = XML(evt.dragSource.dataForFormat("treeItems")[0]); 
    // Drop logic
    // Compare dragNode.localName().length to dropNode.localName().length
    // if drag longer; drop as child
    // if drag is equal; drop as sibling
    // Drag can never be shorter in this example.
    var isChild:Boolean = String(dragNode.localName()).length > String(selNode.localName()).length; 
    if (isChild){
    selNode.insertChildAfter(
    null, dragNode);}
    else
    selNode.parent().insertChildAfter(selNode, dragNode);
    ]]>
    </mx:Script>
    <mx:Tree id="dragTree" width="30%" showRoot="true" height="100%" labelField="@label"dataProvider="
    {dragXMLListCollection}"dragEnabled="
    true" dragMoveEnabled="false" dropEnabled="false" />
    <mx:Tree id="dropTree" width="30%" showRoot="true" height="100%" labelField="@label"dataProvider="
    {dropXMLListCollection}"dragEnter="dragEnter(event);" dragDrop="dragDrop(event);" dragOver="dragOver(event);"
    />
    </mx:Application>

    I just found out that by setting the dataProvider for each tree to the XML variable instead of the XMLListCollection variable, problems #1 and #2 went away!
    But the documentation says to use an XMLListCollection if you will be dynamically changing the tree contents.
    And, I just found out that #1 returns if I specify showRoot="false". But with it set to "true" that problem goes away. Is there some sort of minimum XML required to make drag-n-drop work on these Tree controls?
    Hmmmm. It appears that (for #3) the calculateDropIndex() will always return the last matching XML node - by name - in the tree.

  • Drag-and-drop tree list from files/folder

    Hello all. I'm new to Flex and I'm looking for some help or
    for someone to point me in the right direction. I want to write a
    simple AIR application to accept a multiple text files (or a folder
    full of text files) when the files/folder is dragged into a tree
    list. The file/folder name will be the node name. When selected,
    the contents of the file will be displayed in a text area. The text
    file will contain a 4 x 4 number matrix with each column separated
    by a tab and each row separated by a return. (I plan on plotting
    the numbers in the matrix in the future).
    What I'm most confused about is how to go about
    dragging-and-dropping files into a tree list and creating item
    names based on the file/folder name? And does the file content need
    to go into an array collection?
    Maybe I'm going about this in a difficult way. If there is an
    easier way, I'd appreciate it if someone could share. Thank you
    all.

    I have the same problema and I´m not able to find the reason.
    The solution to get the event raised has been to copy configurations from wd standard appl FPM_TEST_DND_FORM and use my own Z feeder class : all  seems to work perfectly , but , if I try to do it from scratch the event  FPM_DROP_COMPLETED it´s not raised .
    I´ve compared both configurations/class ( the one that I´ve done from scratch  that it doesn´t raise the event and the one that I´ve adapted copying from standard that it raises perfectly  the event) and I haven´t  seen any difference (maybe I haven´t found) .

  • Tree Component Drag and Drop

    Hi, I've been playing around with a trail version of flex and
    was interested to know if anybody had tried to implement the drag
    and drop functionality of the Tree component to a TileList? After
    much messing about I noticed the format of the Tree data in the
    DragSource was different to that of other lists. I've tried
    overriding the addDragData method to see if I can change the format
    of the data although this seems to cause problems when the Drag
    complete event is triggered. Any ideas or help would be
    appreciated.

    Hey, Thanks for the reply. Yes this appears to work although
    it took a bit of messing around and I still had to override the
    dragCompleteHandler method of the Tree component to get the tree
    view to update. One issue I do have (This appears to be an issue
    with the tree component) is as you drag and drop files across from
    one tree to another, when you remove the last child node the parent
    node which has a folder icon changes to a document icon. Is there a
    way around this?

  • How to drag and drop nodes in Tree?

    Hi,
    I want to drag and drop nodes in the tree. For example a tree represents the hierarchy of employees reporting in an organization by using tree.I want to change the reporting an employee visible in the tree by simple drag and drop operation in place of going to another form for updating each employee record indiviually.
    Regards
    Piyush

    Ron,
    I looked into implementing drag / drop in one of the apex trees I created today and ran across this thread. Thank you Ron for the links, it helped a lot.
    I added the code below to my page's "Execute when Page Loads" (tree region id is "tree_reg") and the tree is now drag/drop enabled.
    It did break the [+] icon from collapsing the tree though ... but the apex.widget.tree buttons still work
    var regTree = apex.jQuery("#tree_reg").find("div.tree");
    regTree.tree({ 
    callback : {
    onmove: function(NODE, TREE_OBJ, REF_NODE, TYPE)
    {alert(NODE.id+"   "+TREE_OBJ.id+"   "+ REF_NODE);}
    });Next, I plan on creating a AJAX call using NODE.id, TREE_OBJ.id, and REF_NODE
    V/R
    Ricker

  • How to use the drop event of the tree control in LabVIEW 8.20?

    Hi,
                I am using the two tree controls in my application to provide a option for the user to drag and drop item from one tree to the other.  I have to validate the user selection. I tried to capture the user drop event  using the event structure. The problem I am facing is, I am not able to drop the item even though i have wired a constant true to the filter(Accepted?) in the event case. I have enable the property(Allow droping) in the right menu of the tree control also.
              While configuring an event case for (drop, drag entered and some thing like this) only I am getting the problem otherwise it is working fine.  
    What do i need to do to caprture the drop event ?
    Is there any way to avoid the item duplication while droping a new item in the tree control ?
    or how can i do this?
    Thanks,
    Pandiarajan R

    Hi Pandiarajan,
    I hope you are doing well today! There is a lengthy discussion on the Tree Control Drag & Drop feature at this forums post including contributions from the developer of the Drag & Drop feature:
    Tree Control Drag & Drop in LabVIEW 8
    By avoiding item duplication, do you mean that you don't want the same item to be in the old tree control or do you not want more than one item in the new tree control?
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Drag and drop in same container

    I am having a Vbox and have number of panels inside it.
    I need to add a drag and drop facility to my VBox so that
    using my mouse, I can change the order of panels in my Vbox.

    Hey thanks Tracy. Here is an another method.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    import mx.effects.easing.Back;
    import mx.containers.HBox;
    import mx.containers.Box;
    import mx.controls.Alert;
    import mx.core.IUIComponent;
    import mx.events.DragEvent;
    import mx.managers.DragManager;
    import mx.core.DragSource;
    import mx.collections.ArrayCollection;
    private var mouseIsDown:Boolean=false;
    private var accWin:TitleWindow;
    private var atLeastOneNotVis:Boolean=false;
    private var graphData:ArrayCollection = new
    ArrayCollection();
    private function toggleChartAndCb(graphWin:TitleWindow,
    graphCb:CheckBox, show:Boolean):void{
    graphCb.selected = show;
    this.toggleChart(graphWin,show);
    private function toggleChart(graphWin:TitleWindow,
    show:Boolean):void{
    if(show){
    graphWin.visible=true;
    graphWin.height=150;
    }else{
    graphWin.visible=false;
    graphWin.height=0;
    private function
    dragInit(graphWin:TitleWindow,graphData:ArrayCollection,
    event:MouseEvent,dataFormat:String):void{
    if(mouseIsDown){
    var ds:DragSource=new DragSource();
    ds.addData(graphData,dataFormat);
    DragManager.doDrag(graphWin,ds,event);
    private function
    handleDragEnter(event:DragEvent,dataFormat:String):void{
    if(event.dragSource.hasFormat(dataFormat)){
    DragManager.acceptDragDrop(IUIComponent(event.target));
    private function handleDragDrop(acceptor:TitleWindow):void{
    accWin=acceptor;
    private function handleDragComplete(event:DragEvent):void{
    var initWin:TitleWindow = event.dragInitiator as
    TitleWindow;
    if(accWin!=null && accWin!=initWin){
    var initWinIdx:Number =
    initWin.parent.getChildIndex(initWin);
    var accWinIdx:Number = accWin.parent.getChildIndex(accWin);
    //same parents, just flip
    if(accWin.parent==initWin.parent){
    accWin.parent.setChildIndex(accWin,initWinIdx);
    accWin.parent.setChildIndex(initWin,accWinIdx);
    //not same parent
    else{
    var initChildArr:Array=(Box(initWin.parent)).getChildren();
    var initChildSibling:DisplayObject;
    for each(var initChild:DisplayObject in initChildArr){
    if(initChild.name!=initWin.name){
    initChildSibling = initChild;
    break;
    var initWinRef:DisplayObject=
    initChildSibling.parent.removeChild(initWin);
    accWin.parent.addChildAt(initWinRef,accWinIdx);
    var accWinRef:DisplayObject =
    accWin.parent.removeChild(accWin);
    initChildSibling.parent.addChildAt(accWinRef,initWinIdx);
    override public function localToContent(point:Point):Point{
    return point;
    private function
    checkAndHandleDE(event:DragEvent,cont:Box,dataFormat:String):void{
    if(event.dragSource.hasFormat(dataFormat)){
    var childArr:Array=cont.getChildren();
    var atLeastOneNotVis:Boolean=false;
    for each(var currChild:TitleWindow in childArr){
    if(!currChild.visible){
    atLeastOneNotVis=true;
    break;
    if(atLeastOneNotVis){
    DragManager.acceptDragDrop(IUIComponent(event.target));
    private function
    checkAndHandleDD(event:DragEvent,cont:Box):void{
    var childArr:Array=cont.getChildren();
    for each(var currChild:TitleWindow in childArr){
    if(!currChild.visible){
    accWin=currChild;
    break;
    ]]>
    </mx:Script>
    <!--Checkboxes-->
    <!--I have used checkboxes to show that the panels can be
    toggled-->
    <mx:Panel width="100%" horizontalAlign="center"
    layout="horizontal">
    <mx:CheckBox id="panel1Cb" change="toggleChart(panel1,
    panel1Cb.selected)"
    label="Panel 1" selected="true"/>
    <mx:CheckBox id="panel2Cb" label="Panel 2"
    selected="true"
    change="toggleChart(panel2, panel2Cb.selected)"/>
    <mx:CheckBox id="panel3Cb" label="Panel 3"
    selected="true"
    change="toggleChart(panel3, panel3Cb.selected)"/>
    <mx:CheckBox id="panel4Cb" label="Panel 4"
    selected="true"
    change="toggleChart(panel4, panel4Cb.selected)"/>
    <mx:CheckBox id="panel5Cb" label="Panel 5"
    selected="true"
    change="toggleChart(panel5, panel5Cb.selected)"/>
    <mx:CheckBox id="panel6Cb" label="Panel 6"
    selected="true"
    change="toggleChart(panel6, panel6Cb.selected)"/>
    <mx:CheckBox id="panel7Cb" label="Panel 7"
    selected="true"
    change="toggleChart(panel7, panel7Cb.selected)"/>
    <mx:CheckBox id="panel8Cb" label="Panel 8"
    selected="true"
    change="toggleChart(panel8, panel8Cb.selected)"/>
    <mx:CheckBox id="panel9Cb" label="Panel 9"
    selected="true"
    change="toggleChart(panel9, panel9Cb.selected)"/>
    </mx:Panel>
    <!--Graph Panel-->
    <!--For each row add an HBox and keep the number of
    containers same. You just have to change the id of the container
    and references to it in various events-->
    <mx:HBox id="upperBox" mouseDown="{mouseIsDown=true}"
    mouseUp="{mouseIsDown=false}"
    dragEnter="checkAndHandleDE(event,upperBox,'objFormat')"
    width="100%"
    dragDrop="checkAndHandleDD(event,upperBox)">
    <mx:TitleWindow id="panel1" title="Panel 1"
    showCloseButton="true"
    close="toggleChartAndCb(panel1,panel1Cb,false)" width="100%"
    height="150"
    mouseMove="dragInit(panel1,graphData,event,'objFormat')"
    dragEnter="handleDragEnter(event,'objFormat')"
    dragDrop="handleDragDrop(panel1)"
    dragComplete="handleDragComplete(event)"/>
    <mx:TitleWindow id="panel2" title="Panel 2"
    showCloseButton="true"
    close="toggleChartAndCb(panel2,panel2Cb,false)" width="100%"
    height="150"
    mouseMove="dragInit(panel2,graphData,event,'objFormat')"
    dragEnter="handleDragEnter(event,'objFormat')"
    dragDrop="handleDragDrop(panel2)"
    dragComplete="handleDragComplete(event)"/>
    contied... to next message

  • Drag and Drop Text in FrameMaker 10

    I just installed TCS 3 with Frame 10.  Prior to this release I could triple-click a paragraph and select the following (or previous) paragraphs by dragging the mouse.  Now in Frame 10 after I triple-click, Frame thinks that I want to drag and drop text rather than simply selecting text.  It only selects the one word on which the mouse cursor rests and insists on prompting me to drag the text somewhere.  If I triple-click and release the mouse button, then the whole para is selected, but I cannot select any more text because I have already released the mouse.
    How do I turn off the drag and drop text feature?  I'm finding this "enhancement" frustrating at best.

    AFAIK, the drag'n drop facility is hardwired into the code, so you can't change the behaviour. However, if you've made a paragraph selection using a triple-click, you can select additiona paragraphs by holding down the shift key and single-clicking at the point that you wish your selection to extend to.

  • Drag and drop to public folder

    I have an Intel Mac Mini running 10.4.9 connected to a windows domain & MS Exchange Server 2003 in a corporate environment. My problem: using Mail.app, I can read items within the public folders; however, I cannot drag-and-drop messages from my inbox to folders within the public folders. Any time I attempt this, the message in question is present within the public folder briefly, but then disappears once a sync occurs with Exchange.
    Any suggestions would be greatly appreciated.

    As I wrote before, when I tried to drag and drop the Public Folder Tree Hierarchy, I used account which had delegated Exchange Full Administrator role in Exchange 2003 and was also member of Enterprise Admins / Domain Admins in AD and Exchange Organization
    Administrators in Exchange 2007. According to Sembee suggestion, it is more than needed ...
    I think about manual deleting Public Folder Tree Hierarchy object from old Administrative Group (using ADSIEdit) and then recreating the new one in Exchange Administrative Group - using the following steps:
    http://blog.bruteforcetech.com/archives/766
    But I'm not sure if System Folders will be accessible then. There are many Outlook 2003 in organization, so "old" OAB access is necessary ...
    I can take report of permissions for the problematic Public Folder Tree Hierarchy object using dsacls.exe, if needed (there are many ACEs in DACL on them). I can also check Effective Permission for user I used for moving.
    But in both cases, I don't have any reference. I mean correct permission set for such object or necessary permission set for user used for moving.
    Regards,
    Jacek
    MCT, MCITP, MCTS, MCSE+M, MCSA+M

Maybe you are looking for

  • ICal Notifications (problems)

    I'm having a heck of an introduction into the world if notifications, and I can honestly say, I'm frustrated, so I apologize if this comes off sounding short. I received an important notification from a business partner of mine with all of the detail

  • How to delete the records with routine Z_AFRP4_DELETE as note [418584|

    Hello Gurus, I don't want to transfer data into HR and want to delete the records in table AFRP4 to business complete the Maintenance Orders Component version- EHP7 for SAP ERP 6.0 Component-EA-APPL Release-617 how can I delete these records Thanks f

  • API for WVC210

    Is there an API for the WVC210 video camera?

  • S4 Problems Trying to Update 4.3

    My phone starts out fully charged but within 2 hours the battery completely dies. I never have wifi, mobile data, GPS, screen pause, or any other features on and I always close my applications, clear the task manager, and the cache. This problem pers

  • MBAM client installation fails

    I facing a strange issue while installing MBAM client in windows 7 enterprise. I am using the CLI method to install client on Test machines and it give error "Program to big to fit into Memory". Did anyone faced this kind of issue? If yes please advi