Control Framework tree control event not trigerring

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

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

Similar Messages

  • Issue : drag and drop from list control to tree control

    Hi,
    I was trying a drag and drop from list control to tree control. I have used some sample data to populate list and tree controls .
    It is working fine . except one problem ..
    Prob : when i drag an item to tree control .. it gets added .. now tree contains (X+1) data in list .. say X is the inital number of nodes in a tree node.
              now if i drag another item from list to last item in the tree node  .. i.e at X+1 index. .. it throws null pointer exception.
    I am considerably new in flex programming . looking for help from experts ..
    Below is my code :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="horizontal"
                    creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import mx.controls.listClasses.IListItemRenderer;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                import mx.utils.ObjectUtil;
                import mx.collections.ICollectionView;
                import mx.core.UIComponent;
                import mx.managers.DragManager;
                import mx.events.DragEvent;
                import mx.controls.Alert;
                import mx.controls.Label;
                import mx.events.CloseEvent;
                private var homePath:String="/home/e311394/dndTest/";
                private var destPath:String="/home/e311394/dndDest/";
                private var eid:String="e311394";
                private var actn:String;
                [Bindable]
                private var cm:ContextMenu;
                private var cmi:ContextMenuItem;
                [Bindable]
                private var dp:ArrayCollection;
                private function init():void
                    cmi=new ContextMenuItem("Remove");
                    cmi.enabled=true;
                    cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_menuItemSelect);
                    cm=new ContextMenu();
                    cm.hideBuiltInItems();
                    cm.customItems=[cmi];
                    cm.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenuItem_menuSelect);
                    list.contextMenu=cm;
                private function contextMenuItem_menuSelect(evt:ContextMenuEvent):void
                    list.selectedIndex=lastRollOverIndex;
                private function contextMenuItem_menuItemSelect(evt:ContextMenuEvent):void
                    var loclSelectedRow:Object=list.selectedItem;
                    var lostrSelectedMenuItem:String;
                    lostrSelectedMenuItem=evt.target.caption;
                    if (loclSelectedRow != null)
                        var obj:Object=new Object()
                        obj.label=loclSelectedRow.label as String;
                            //Alert.show(obj.label);
                    if (lostrSelectedMenuItem == "Remove")
                        if(loclSelectedRow!=null)
                        var pth:String=homePath.concat(loclSelectedRow.label);
                        //Alert.show(pth);
                        //FlexDnDRemoteService.process(eid,"delete",pth,"-"); 
                        var coll:ArrayCollection=list.dataProvider as ArrayCollection;
                        if (coll.contains(loclSelectedRow))
                            coll.removeItemAt(coll.getItemIndex(loclSelectedRow));
                public function onTreeDragEnter(event:DragEvent):void
                    event.preventDefault();
                    DragManager.acceptDragDrop(event.target as UIComponent);
                    tree.showDropFeedback(event);
                protected function onTreeDragOver(event:DragEvent):void
                    event.preventDefault();
                    event.currentTarget.hideDropFeedback(event);
                    try
                        var index:int=tree.calculateDropIndex(event);
                    catch (e:Error)
                        DragManager.showFeedback(DragManager.NONE);
                        return;
                    tree.selectedIndex=index;
                    var draggedOverItem:Object=tree.selectedItem;
                public function onTreeDragExit(event:DragEvent):void
                    event.preventDefault();
                    tree.hideDropFeedback(event);
                private function showAlert():void
                    Alert.yesLabel="Move";
                    Alert.noLabel="Copy";
                    Alert.buttonWidth=70;
                    Alert.show("Copy / Move ?", "Confirm", Alert.YES | Alert.NO | Alert.CANCEL, this, alertListener, null, Alert.OK);
                private function alertListener(eventObj:CloseEvent):void
                    var result:Boolean=false;
                    if (eventObj.detail == Alert.CANCEL)
                        //Alert.show("CANCEL");
                        return;
                    if (eventObj.detail == Alert.YES)
                        //Alert.show("YES");
                        result=true;
                    else if (eventObj.detail == Alert.NO)
                        //Alert.show("NO");
                        result=false;
                    var index:int=tree.calculateDropIndex(treedropevt);
                    //Alert.show("Drop Pos" + index.toString());
                    /* var treeList:ArrayCollection=tree.dataProvider as ArrayCollection;
                       Alert.show(" index"+index+"Length "+treeList.length);
                       if(index > treeList.length)
                       Alert.show("Returning");
                       return;
                    var items:Array=new Array();
                    if (treedropevt.dragSource.hasFormat("items"))
                        items=items.concat(treedropevt.dragSource.dataForFormat("items") as Array);
                    var parentItem:Object;
                    parentItem=getObjectTarget();
                    /* if (tree.dataDescriptor.isBranch(tree.indexToItemRenderer(index).data))
                       parentItem=tree.indexToItemRenderer(index).data;
                       else
                       var dropParentPackage:Object = tree.mx_internal::_dropData.parent as Object;
                       Alert.show("HAck"+dropParentPackage.toString());
                       parentItem=tree.getParentItem(tree.indexToItemRenderer(index).data);
                       //Alert.show("Lenght "+ObjectUtil.getClassInfo(parentItem).properties.length);
                    //Alert.show("Lenght "+ObjectUtil.getClassInfo(parentItem).properties.length);
                    var position:int=0;
                    /* if(ObjectUtil.getClassInfo(parentItem).properties.length==0)
                       Alert.show("Returning");
                       return;
                    if (parentItem != null)
                        try
                            while (tree.indexToItemRenderer(index).data != parentItem)
                                //Alert.show(tree.indexToItemRenderer(index).data.toString());
                                if (index > 0)
                                    index--;
                                //Alert.show("Insiade");
                                position++;
                        catch (e:Error)
                            Alert.show("Catch" + index.toString());
                            return;
                    for each (var item:Object in items)
                        var obj:Object=new Object()
                        obj.label=item.label as String;
                        if (parentItem != null)
                            //Alert.show("ADDED");                       
                            tree.dataDescriptor.addChildAt(parentItem, obj, position++);                       
                        else
                            //Alert.show("PARENT NULL");
                            tree.dataDescriptor.addChildAt(tree.selectedItem, obj, position++);                       
                        var spth:String=homePath.concat(item.label);
                        //Alert.show(spth);   
                        var dpth:String=destPath.concat(item.label);
                        //Alert.show(dpth);
                        if (result == true)
                            removeItems();
                                //FlexDnDRemoteService.process(eid,"move",spth,dpth);
                        else
                            //FlexDnDRemoteService.process(eid,"copy",spth,dpth);
                        tree.validateNow();
                public function getObjectTarget():Object
                    var dropData:Object=tree.mx_internal::_dropData as Object;
                    if (dropData.parent != null)
                        return dropData.parent;
                    else
                        // if there is not parent (root of the tree), I take the root directly
                        var renderer:IListItemRenderer=tree.indexToItemRenderer(0);
                        return renderer.data;
                public function removeItems():void
                    //remove moved elements
                    var items:Array=treedropevt.dragSource.dataForFormat("items") as Array;
                    var coll:ArrayCollection=list.dataProvider as ArrayCollection;
                    for each (var item:Object in items)
                        if (coll.contains(item))
                            coll.removeItemAt(coll.getItemIndex(item));
                private var treedropevt:DragEvent;
                public function onTreeDragDrop(event:DragEvent):void
                    treedropevt=event;
                    showAlert();
                    event.preventDefault();
                    tree.hideDropFeedback(event);
                public function resultHandler(event:ResultEvent):void
                    Alert.show("Success", "Status");
                public function faultHandler(event:FaultEvent):void
                    Alert.show(event.fault.faultString, "Failure");
            ]]>
        </mx:Script>
        <mx:ArrayCollection id="listDP">
            <mx:Object label="File1.dnd"/>
            <mx:Object label="File2.dnd"/>
            <mx:Object label="File3.dnd"/>
            <mx:Object label="File4.dnd"/>
            <mx:Object label="File5.dnd"/>
        </mx:ArrayCollection>
        <mx:Number id="lastRollOverIndex"/>
        <!--
             <mx:ArrayCollection id="treeDP">
             <mx:Object label="/home">
             <mx:children>
             <mx:Object label="dummy1.ks"/>
             <mx:Object label="dummy2.ks"/>
             <mx:Object label="e493126">
             <mx:children>
             <mx:ArrayCollection>
             <mx:Object label="/home/e493126/sample1.ks"/>
             </mx:ArrayCollection>
             </mx:children>
             </mx:Object>
             </mx:children>
             </mx:Object>
             </mx:ArrayCollection>
        -->
        <mx:ArrayCollection id="treeDP">
            <mx:Object label="/dndDest">
                <mx:children>
                    <mx:ArrayCollection>
                        <mx:Object label="sample1.ks"/>
                        <mx:Object label="sample2.ks"/>
                        <mx:Object label="sample3.ks"/>
                        <mx:Object label="sample4.ks"/>
                        <mx:Object label="sample5.ks"/>
                        <mx:Object label="sample6.ks"/>
                    </mx:ArrayCollection>
                </mx:children>
            </mx:Object>
        </mx:ArrayCollection>
        <mx:List id="list"
                 itemRollOver="lastRollOverIndex = event.rowIndex"
                 width="50%"
                 dragEnabled="true"
                 dataProvider="{listDP}"
                 labelField="label"
                 allowMultipleSelection="true"
                 dragMoveEnabled="false">
        </mx:List>
        <mx:Tree id="tree"
                 width="50%"            
                 dragEnabled="true"            
                 dataProvider="{treeDP}"            
                 dragEnter="onTreeDragEnter(event)"
                 dragOver="onTreeDragOver(event)"
                 dragExit="onTreeDragExit(event)"
                 dragDrop="onTreeDragDrop(event)"
                 labelField="label"
                 liveScrolling="true">
        </mx:Tree>
        <mx:RemoteObject id="FlexDnDRemoteService"
                         showBusyCursor="true"
                         destination="FlexDnD">
            <mx:method name="process"
                       result="resultHandler(event)"
                       fault="faultHandler(event)"/>
        </mx:RemoteObject>
    </mx:Application>
    Thanks,
    Rajiv

    Ya , i have searched and have used the same code.
    But needed to customize few things like:
    stop dnd in same tree
    drop some item into a folder ..( onto it ) etc
    have achieved the same .. but this issue ..
    i think the tree dataprovider (contents internally is not being updated .. only the UI)
    any suggestions ?
    - Rajiv

  • Drag & Drop, ALV or Table Control to Tree Control

    Hi Experts,
    If i want Drag & Drop feature in ALV or Table Control to Tree Control

    Hi,
      refer to the link below:
    http://help.sap.com/saphelp_46c/helpdata/fr/22/a3f5fbd2fe11d2b467006094192fe3/content.htm
    With luck,
    Pritam.

  • 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

  • Tree Control Drop? Event in LV 8

    Hi,
    I developed one application using LV 7.1 which uses tree control Drop? event.
    using this event I can get and compare source tag and target tag and based on result I can omite the Drag and Drop event.
    But in LV 8 for Drop? event I am not getting Source and Target Tags. Same function how I can implement in LV 8.0?

    Hello,
    There is a lengthy thread on this topic here (including comments from the owner of Drag-and-Drop on the LabVIEW team):
    http://forums.ni.com/ni/board/message?board.id=170&message.id=158683
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • How to handle events occuring on different items in a tree control

    I am developing a small application in which I need to display different panels when user clicks on a tree control item....how to make it display a panel inside a parent panel when a user clicks an item in a tree control....any help would be greatly appreciated. thank you
    If you are young work to Learn, not to earn.

    The tree control can handle several events that you can rely on to handle user interaction. I suggest you take a llok at treeevent.prj example that comes with CVI. In your situation, one possible event to handle is EVENT_SELECTION_CHANGE, that marks the operation the user does when clicking on a new tree item.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Af:tree control expand is not working

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

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

  • Events not getting fired for templated controls.

    Hi,
    I have an asp.net custom server control, in which I have given template support. The template controls render fine. But, the events of template controls are not getting fired. For example, If I added an asp dropdownlist as a template in my custom control
    and select any item from dropdownlist and raised the postback, the selected item did not get updated in dropdownlist ( i.e selectedIndex, selectedText of the control remains the same as like initial rendering.), also I am not able to trigger the SelectedIndexChanged
    server side event of dropdownlist.
    I have used NamingContainer for rendering the template controls. The codes are as follows,
    <code>
    This is my source:
         private
    ITemplate fileTemplate =
    null;
     [TemplateContainer(typeof(ContentContainer)),
    PersistenceMode(PersistenceMode.InnerProperty),
    DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
    TemplateInstance(TemplateInstance.Single)]
    public ITemplate FileTemplate
    get
       return fileTemplate;
    set
    fileTemplate = value;
    public class
    ContentContainer :
    WebControl, INamingContainer
    internal ContentContainer()
    protected override
    void CreateChildControls()
    this.Controls.Clear();
    ContentContainer container =
    new ContentContainer();
    this.FileTemplate.InstantiateIn(container);
    this.Controls.Add(container);
    base.CreateChildControls();
          public
    override ControlCollection Controls
    get
    this.EnsureChildControls();
           return
    base.Controls;
    Whereas in my application, I have rendered the custom control with template as below,
    [ASPX]
    <mycustom control>
    <FileTemplate>
    <asp:DropDownList
    ID="ddc1"
    runat="server"
    AutoPostBack="true"
    OnSelectedIndexChanged="ddc1_SelectedIndexChanged"
    >
    <asp:ListItem
    Text="Item1"
    Value="one"></asp:ListItem>
    <asp:ListItem
    Text="Item2"
    Value="two"></asp:ListItem>
    <asp:ListItem
    Text="Item3"
    Value="three"></asp:ListItem>
    <asp:ListItem
    Text="Item4"
    Value="four"></asp:ListItem>
    </asp:DropDownList>
    </FileTemplate>
    </mycustom control>
    [Code Behind]
    This event is not getting raised.
    protected
    void ddc1_SelectedIndexChanged(object sender,
    EventArgs e)
     I can get the template control's details here using "FindControl("templateID")". But not able to get the updated details.
    protected void btn_Click1(object sender,
    EventArgs e)
    var template= this.CustomControl.Controls[0].FindControl("ddc1");
    </code>
    Where I am going wrong? Kindly help me on this.
    Thanks in advance.
    Regards,
    Meena

    This is a Windows Phone forum, not a web development forum. Please ask this question at the forums at
    http://asp.net.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Handling event for Tree Control Collapse

    Hi,
    Can any one suggest how to handle an event for 'Tree Node Collapse' . I have checked with all the exised tree events.
    thanks,
    Venu

    Hi Venugopal,
        If you are doing tree control programmin then i can suggest you a approach for tree node collapse and expand.
    for doing this follow these steps.
    1. create a toolbar (use class cl_gui_toolbar), add a button and assign a FCODE to it.
    2. here you register the following the event for the toolbar.
    gs_event-eventid = cl_gui_toolbar=>m_id_function_selected.
    3. here you set the handler for the toolbar events
      SET HANDLER  gref_application->handle_function_selected
                FOR  gref_toolbar.
    4. now in your class for gref_application you write a definition and implementation.
    definition
    handle_function_selected FOR EVENT handle_function_selected OF cl_gui_toolbar IMPORTING fcode.
    implementation
    CASE fcode.
       when 'collapse'.
          CALL METHOD xref_tree->collapse_all_nodes.
    this method might change depending upon the class you use for creating the tree.
    i hope this will help you.
    in case of clarification do get back to me.
    regards,
    Kinshuk Saxena
    PS mark helpful answers

  • Not able to get the database data into the Tree Control

    Hi Everybody,
                        I have to populate the tree control with nodes and items, which is to be populated from the database, and the tree control is <b>dynamic</b>. I mean, there is a <b>toolbar</b>, whenever a <b>pushbutton is clicked</b>, depending on that the tree contents has to be changed.
    If anybody had worked with <b>CL_GUI_COLUMN_TREE</b> control to get the data from database, depending upon the <b>pushbutton selected in Toolbar</b>, please paste the seudocode for it.
    Regards,
      Abdul,
    Intelligroup.
    P.S: Helpful answers will be rewarded.

    have you seen this demo program
    SAPCOLUMN_TREE_CONTROL_DEMO
    Regards
    Raja

  • How to Flex tree control using folder click event  to pass coldfusion to get data from dynamiclly ?

    Hi friends.........
                Iam using flex tree control data coming from coldfusion file to display grid. As i click the tree folder to change the data from dynamic from grid.
    How to pass the folder id from coldfusion file.. Is it possible ?.. Means give any example please....
    Any One Help Me......
    With Regards.,
    Lingu.......

    When you set the dataProvider for your tree control, you actually pass an array or arraycollection or whatever to that property. The array contains objects coming from your server, right? Each object should contain a property with the folder id, something like:
    var arr:Array = [{id: 1, folderID: 34, name: "..."}, {id: 2, folderID: 4, name: "..."}, ...];
    Now, when you click an item in your tree or your dataGrid, you can access the folder id by:
    myTree.selectedItem.folderID
    Hope this helps
    Dany

  • Tree control events

    Hi all,
    I would like to add special handler in case of right click on the Tree control nodes.
    Is there any way to do it?
    Thanks in advanced,
    Yaacov (Kobi) Pinhas.
    Message was edited by: Yaacov Pinhas

    You cannot do that (yet).
    Armin

  • How to change the symbol not provided by LV in tree control

    AS we know ,Lv7.0 provide the new "tree" control
    ,but the symbol provided is just some black_white
    icon.if I want to chang the icon as I enjoy ,
    how to do?

    You can create your own symbols (icons) for the tree control. First, create an invoke node for your tree control and select "Custom Item Symbols -> Set Symbol Array". You must build an array of images to feed to the method. You can right-click on the item in the invoke node and select Help for it.
    Once your custom symbol array is set, you can designate an icon for each item on the tree with the property "Active Item Properties -> Symbol Index".
    Daniel L. Press
    PrimeTest Corp.
    www.primetest.com

  • Flex Scrolling Bug in Tree control

    <mx:Tree id="tree" labelField="@label" minHeight="400">
              <mx:XMLListCollection id="xmlList">
                        <fx:XMLList id="root" xmlns=www.ns.com>
                        <node label="aaaa">
                                  <node label="aaaDesc"/>
                        </node>
                        ... more nodes
                        </fx:XMLList>
              </mx:XMLListCollection>
    </mx:Tree>
    thats pretty much the basic code that i have
    when scroller is added this functionality doesnt work.
    TypeError: Error #1010: A term is undefined and has no properties.
    at mx.controls::List/adjustVerticalScrollPositionDownward()[E:\dev\4.5.1\frameworks\projects \mx\src\mx\controls\List.as:1043]
    at mx.controls::List/configureScrollBars()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\contro ls\List.as:988]
    at mx.controls::List/scrollHandler()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\Lis t.as:1629]
    at mx.controls::Tree/scrollHandler()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\Tre e.as:2898]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\co re\UIComponent.as:13128]
    at mx.controls.scrollClasses::ScrollBar/http://www.adobe.com/2006/flex/mx/internal::dispatchScrollEvent()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\scrollClasses\ScrollBar.as:1472]
    at mx.controls.scrollClasses::ScrollThumb/mouseMoveHandler()[E:\dev\4.5.1\frameworks\project s\mx\src\mx\controls\scrollClasses\ScrollThumb.as:216]

    The problem went away. I think it was a bug getting triggered
    by setting the selected items after I had updated the dataProvider
    and refreshing the tree.
    I was having another issue where the selectedItems were lost
    after updating the tree. I fixed it by setting selectedItems using
    callLater() because setting it immediately after updating the tree
    dataProvider was not working as the selection was lost anyways.
    using callLater to do this fixed the selection issue and now
    apparently also the issue with a section of the tree being
    obscured.

  • How can I drag and drop an item from one Tree control to another in LabVIEW 7.1?

    You can use the mouse up and down event on the two tree controls but the problem is making the correct selection in the second tree control. I want to be able to switch over to the selection bar of the second tree control so that I can place my item in the correct position. I know all possible workarounds with double-clicks and so on... but I really want a windows drag and drop.
    This is what I have for the moment. Please check the library below. I need to activate the selection bar of the second tree control somehow to get the position in the control. The VI below is written in LV 7.1
    Attachments:
    Drag&Drop.llb ‏65 KB

    Hi Jones,
    As far as I know this feature is currently not supported by the Tree control. A workaround, would be to use the vertical position of the mouse in the button up event to determine what line you�re dropping the item.
    If you would like the Tree control to include the drag and drop feature, please submit this as a Product Suggestion under the feedback at www.ni.com/contact.
    Good luck!
    Best regards,
    Philip C.
    Applications Engineer
    National Instruments
    www.ni.com/ask
    - Philip Courtois, Thinkbot Solutions

Maybe you are looking for