Flex Tree - leaf object height is overlapping.

Hello folks,
   I am trying to build a tree component with an item renderer as below: The Text Area what I am adding as leaf node is overlapping on the next item branch node. As Tree extends List, I sent VariableRowHeight property to true. Some how tree is not treating this object as a leaf node it seems.
Could you please guide me ??
package my.renderers
import flash.display.DisplayObject;
import mx.controls.TextArea;
import mx.controls.Tree;
import mx.controls.listClasses.ListBase;
import mx.controls.treeClasses.TreeItemRenderer;
import mx.controls.treeClasses.TreeListData;
public class MyTreeItemRenderer extends TreeItemRenderer
public function MyTreeItemRenderer()
super();
override protected function commitProperties():void
super.commitProperties();
var textArea = new TextArea();
override protected function createChildren():void
super.createChildren();
textArea.width=200;
textArea.height= 80;
textArea.includeInLayout = true;
override public function set data(value:Object):void
super.data = value;
var _tree:Tree = Tree(this.parent.parent);
var tld:TreeListData= TreeListData(listData)
if(!_tree.dataDescriptor.isBranch(value))
ListBase(this.parent.parent.parent.parent).rowHeight = textArea.height;
trace("This is a Leaf, and so adding the Child Element" + value.toString());
this.parent.parent.addChild(textArea);
if(_tree.dataDescriptor.isBranch(value))
if(_tree.contains(textArea))
trace("This is not a Leaf and so remove the Child Element");
removeChild(DisplayObject(textArea));
override protected function updateDisplayList(
unscaledWidth:Number, unscaledHeight:Number):void
super.updateDisplayList(unscaledWidth, unscaledHeight);
var tld:TreeListData= TreeListData(listData)
var _tree:Tree = Tree(this.parent.parent);
if(_tree.dataDescriptor.isBranch(tld.item))
if(super.icon) {
super.icon.visible=true;
if(super.label){
super.label.visible=true;
else
if(super.icon)
super.icon.visible=false;
if(super.label)
super.label.visible=false;
<my:MyTree
variableRowHeight="true"
indentation="0"
defaultLeafIcon="{null}"
folderClosedIcon="{null}"
folderOpenIcon="{null}"
width="100%" height="100%"
dataProvider="{treeData}"
showRoot="false"
labelField="@label" />
package my.controls
import flash.events.MouseEvent;
import mx.controls.Tree;
import mx.controls.listClasses.IListItemRenderer;
import mx.core.ClassFactory;
import my.renderers.MyTreeItemRenderer;
* This class extends the Tree adding separator node capability. 
public class MyTree extends Tree
//  Constructor
* Constructor.
public function MyTree()
super();
itemRenderer = new ClassFactory(MyTreeItemRenderer);
//  Overridden methods
         * Override to prevent separator to be visually highlighted.
        override protected function mouseOverHandler(event:MouseEvent):void
return;
        var item:IListItemRenderer = mouseEventToItemRenderer(event);
        if (item != null && !MyTreeItemRenderer(item).isSeparator)
                super.mouseOverHandler(event);
         * Override to prevent separator to be selected.
        override protected function mouseDownHandler(event:MouseEvent):void
return;
        var item:IListItemRenderer = mouseEventToItemRenderer(event);
        if (item != null && !MyTreeItemRenderer(item).isSeparator)
                super.mouseDownHandler(event);

Thanks pm.  I finally got it to work.  Apparently the functions implemented when using ITreeDataDescriptor don't always make sense.  To get something to be seen as a leaf and not a branch.  item.isBranch can't be the only to show false.  The item.getChildren call must also return a null ICollectionView or something crazy like that , otherwise , your leaves will have disclosure symbols beside them.

Similar Messages

  • Populate Flex Tree from Java Code (Database)

    Hi
    Can someone please help me? I'm very new to using flex. I'm
    basically trying to create a tree that is populated from data in my
    database. I am using hibernate to fetch that data.
    The plan is to basically create the tree in Java code (since
    I don't want any processing done on the client PC) and then pass
    this to the flex tree (or an actionscript data structure that is
    compatible as the tree datasource)
    I am creating the java tree using DocumentImpl. Is this
    correct? What class would work?
    Element e = null;
    Node n = null;
    Document xmldoc= new DocumentImpl();
    Element root = xmldoc.createElement("USERS");

    quote:
    Originally posted by:
    ntsiii
    Stop running and get a map (read the documents)
    This is hardly a useful comment and must discourage new users
    from asking questions. If you think the documentation relating to
    the use of the tree control is straightforward then I beg to
    differ.
    If you are aware of a clear example of how to use the data
    tree with a php backend returning a remote data object please
    enlighten me. Meanwhile I continue my search but not within the
    livedocs.
    One site I have found that may be of use is
    http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
    Not everyone is an expert.

  • 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

  • Flex Tree Vertical Scroll Bar Issue

    When i click on the + image of flex tree than first time the vertical scroll bar is not coming but when when i minimize it and again click on + than it appears can any one tell me what is the issue??

    Hi Rob,
    I have tried changing styles of those div's in  which I have my dropdown's are there but it didnt work.
    Below is the code for reference:
    <div class="k-animation-container km-popup" style="width: 250px; height: 206px; margin- padding- padding-right: 10px; padding-bottom: 15px; display: none; "><div class="k-list-container k-popup k-group
    k-reset" id="MaintenanceType-list" data-role="popup" style="height: 200px; display: none; font-family: 'Segoe UI', Verdana, Tahoma, Arial; font-size: 11px; font-style: normal; font-weight: normal; line-height: normal; width: 244px; -webkit-transform: translateY(-206px);"><ul
    unselectable="on" class="k-list k-reset" tabindex="-1" role="listbox" aria-hidden="true" id="MaintenanceType_listbox" aria-live="off" style=""><li tabindex="-1" role="option" unselectable="on" class="k-item"></li><li tabindex="-1" role="option"
    unselectable="on" class="k-item">AUX - Accessories belonging to EA group</li><li tabindex="-1" role="option" unselectable="on" class="k-item">ARL - Artificial Lift</li>
    Regards,
    Jyothi

  • Issue with child items of flex tree using QTP

    Hi,
    We are trying to automate Flex web application using QTP10.
    We are facing below issue with Flex tree when we try to automate a scenario of selecting a child item displayed in flex tree.
    Issue:
    On recording the step of selecting an item from Flex tree using QTP, the script displayed is .Select Index1. But when we replay it back no action is being performed.
    Also on object spy we are able to navigate only till flex tree and we are not able to spy child items of flex tree.On the web page the child items are displayed as radio buttons/checkboxes.
    Please provide a solution for me to this problem.
    Thanks

    Hi,
    You could perform a HTTP trace (using HTTP watch) and compare the OCI data in POST method for both users (the correct and incorrect ones).
    Perhaps there is some additional/missing information being passed from catalog to SRM.
    Kind regards,
    Ricardo

  • Adding image for the selected Tree leaf???

    Hi All,
             I am working with flex tree component in which i have to add
    an arrow image for the  selected leaf node. I tried to do this using itemclick event
    but cant make it. can you help me out in doing this???
    Note: I have written custom Tree and TreeItemRenderer...
    -Sundar

    Thanks for ur reply Grizzzzzzzzz,
                                                    is there a way to identify the selected leaf from within MyTreeItemRenderer(Extends TreeItemRenderer)?
                                                   If this is possible,i can add the image to the selected leaf of the tree.
    Right now i am assigning images to all the leaf nodes of the tree as follows:
    public  
    class MyTreeItemRenderer extends TreeItemRenderer
    * Override to draw a line in case current item is a leaf.
     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):
    void{ 
    // Call super method 
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    if(super.data){
    if(TreeListData(super.listData).hasChildren){
    // logic for parent node comes here
    else{ 
    //Adding leaf Image
    //Logic to add images to leaf 
    myImage.source = leafImage;
    myImage.x =
    super.label.x;
    //The above code adds images to all leaf nodes. CAN I ADD THIS IMAGE ONLY TO THE SELECTED LEAF NODE???
    //HOW TO FIND THE SELECTED LEAF NODE FROM HERE??? SO THAT SELECTED LEAF WILL BE ADDED WITH THE IMAGE???
    //The above code adds images to all leaf nodes. CAN I ADD THIS IMAGE ONLY TO THE SELECTED LEAF NODE???
    //HOW TO FIND THE SELECTED LEAF NODE FROM HERE??? SO THAT SELECTED LEAF WILL BE ADDED WITH THE IMAGE???
    THANKS,
    SUNDAR 

  • Tree leaf drag to bottom folder

    Hi !
    With the following code, it seems impossible to drag leaf
    "rio" (for instance) and drop it as the last child of "Europe" when
    leaf "Spain" is expanded.
    The only thing possible is to drop it as a child of "Spain"
    or as a new and last root leaf.
    This does not seem to be normal as you could drop "rio"
    between "Spain" and "England", hence as a child of "Europe"
    Thanks !
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private function init():void {
    for each ( var child:XML in treeData..node )
    tree.expandItem(child, true);
    ]]>
    </mx:Script>
    <mx:XML id="treeData" xmlns="">
    <root>
    <node label="Americas">
    <node label="US">
    <node label="New York" />
    <node label="Chicago" />
    <node label="Los Angeles" />
    </node>
    <node label="Brazil">
    <node label="Sao Paolo" />
    <node label="Brazilia" />
    <node label="Rio" />
    </node>
    </node>
    <node label="Europe">
    <node label="England">
    <node label="London" />
    <node label="Manchester" />
    </node>
    <node label="Spain">
    <node label="Madrid" />
    <node label="Barcelona" />
    </node>
    </node>
    </root>
    </mx:XML>
    <mx:Tree width="100%" height="70%" id="tree"
    labelField="@label"
    dataProvider="{treeData.node}"
    allowMultipleSelection="false"
    dragEnabled="true"
    dropEnabled="true"
    dragMoveEnabled="true"/>
    </mx:Application>
    last

    Not without changing the source code, which only Apple have access to.
    Safari menu > Reports Bugs to Apple... ?

  • Populate a canvas when a tree-leaf node is clicked

    I'm trying to populate a canvas or a list container with
    images when a tree-leaf node is clicked. I got the tree control
    working alright so far (populated via an external XML) but I'm
    having a hard time figuring out how to populate the adjacent
    container when a leaf node from a tree is clicked by a user. I know
    I'm supposed to code this in the 'change' event but am having a
    difficult time trying to figure out how to do this. I looked at the
    source code in some of the sample apps but I couldn't find anything
    that resemble what I'm trying to do.
    Since each leaf node would be unique, each one of them would
    trigger an external load of images (via http service) ... and so
    the url would be unique as well for each.
    'Appreciate the help from anyone who could help.
    Thanks.

    Thanks for the quick response Tracy ...
    Actually, I don't have mage load part coded yet :) ... I do
    have a somewhat general idea on how it should be coded though (i
    think, hehe). I'm thinking the selected item in the leaf node would
    have the data for the 'url' or 'folder location' of the images that
    would have to be retrieved and displayed in the canvas. I'm just
    not sure how to go about diplaying them in the canvas. Do I have to
    load them in some sort of array first and then datasourced it for
    my canvas? Not really sure how to go about doing it ... 'am totally
    newbie with Flex and just learning it by going through the online
    help and looking at the codes on some of the sample apps.
    Thanks again.
    pixelflip

  • Dataprovider for Flex Tree

    how do you dynamically populate nodes in the Flex tree with data from a database?
    For example... if I have a node for Groups and a database for names of groups... how would I populate the child nodes of the Groups folder with the names of the groups in the database?

    alright i'll experiment. you may be able to help me understand why this isn't working though... this is the route i was going down:
    i wanted to convert this mxml to actionscript and bind it to the tree (so i can add results from my dataprovider):
        <mx:XMLListCollection id="treeData">
            <mx:source>
          <mx:XMLList>
                  <node label="Items">
                      <node label="Open"/>
                      <node label="In Progress"/>
                  </node>
          </mx:XMLList>
            </mx:source>
        </mx:XMLListCollection>
    and i was trying this code to make it bindable:
    var stringData:String = '<node label="Items">' + '<node label="Open"/>' + '<node label="In Progress"/>'
    + '</node>';
    var treeData= new XMLList(stringData);
    but when i use actionscript to create the treeData variable... and use {treeData} as the binding data... nothing shows in my tree.

  • How we can show the xml data without any attribute in a flex tree (without having any label field) ?

    how we can show the following data in a flex tree (without having any
    label field) ?
    <?xml version="1.0"?>
    <rootNode>
            <childNode>
            < subchildNode >
                    <valueNode>1000</valueNode >
                    < valueNode >999-888-777</valueNode >
                    < valueNode >STORTZ</valueNode >
                    < valueNode >PAM STORTZ</valueNode >
                    < valueNode >88 ST. MORTON ROAD</valueNode>
            </subchildNode>
            </childNode >
    </rootNode >

    as is - no how
    wrap those xml chunk with a class having clear public properties like:
    public class dataRecord {
         protected var xml:XML;
         function dataRecord(xml:XML) {
              this.xml = xml;
         public function get id ():String {
              return XML(xml.descendants("valueNode")[0]).toString();
         // and so on
    simpliest way is to change xml structure to use attributes than wrapping that thing with AS code, it's time consuming and non efficient.

  • Change the root of Flex Tree dynamically

    I have a Flex Tree constructed dynamically. The dataprovider is xmllistcollection.The user clciks on a button to add an item(node) to the tree.
    when user tries to add 2nd item to the tree I want to create root(with a button) at the top automatically.
    So  a Root need to be created dynamically after 2nd item is added.
    Can someone please help me in getting this.
    I am using MXTreeItemrender  as Itemrender and was able to add nodes. But I could not get the third item(I am taking this xml node as Branch and adding) added to the top of the tree.
    Any help is very much appreciated

    Or in APEX 4.0 this can be done using a Dynamic Action that executes JavaScript code to change the region title.
    Give the region a static region ID for use in a jQuery selector.
    As solutions may be dependent on APEX version&mdash;among other factors&mdash;always specify the following information in your initial post:
    <li>APEX version
    <li>DB version and edition
    <li>Web server architecture (EPG, OHS or APEX listener)
    <li>Browser(s) used
    <li>Theme
    <li>Templates
    <li>Region type

  • Edit node name in flex tree

    I want to edit a node in flex tree. Editable property of the
    tree makes all nodes editable based on "SELECT" action . But now
    based on my custom selection I want to edit a particular node. I
    thought of custom item renderer and item editor but that applies to
    all the nodes on "SELECT" action. Please let me know how to edit
    particular nodes based on particular action.
    Ex: On click of a button i want to edit the name of node
    (Node is just text with folder icon).
    Tx..
    Flextron

    Flextron,
    I was trying to find an answer to the same issue. After
    walking through the Tree and List class a bit I came up with this.
    Here is an example where the Tree is not editable and double
    clicking a node will allow you to rename it.
    tree.addEventListener( ListEvent.ITEM_DOUBLE_CLICK,
    itemDoubleClick );
    tree.addEventListener( ListEvent.ITEM_EDIT_END, itemEditEnd
    private function itemDoubleClick( event:ListEvent=null
    ):void
    tree.editable = true;
    tree.editedItemPosition = {rowIndex:tree.selectedIndex};
    private function itemEditEnd( event:ListEvent=null ):void
    tree.editable = false;
    - Jank

  • Flex tree

    Hi. I have some problem with Flex tree component.
    When I have XML (1), then I have correct tree output
    folder
    -item
    -item
    But when I create something like(2) , then I will have folder
    XXX like item.
    How can I solve it ?

    hi theosa
    try these
    <folder label="XXX" isBranch="true"/>

  • ALV tree using Objects

    Hi,
    I am making an ALV tree using objects and the code is crashing due to an error in the Screen 100 ( which I am using ). I tried to implement the example provided at http://www.sapdevelopment.co.uk/reporting/alv/alvtree.htm but that is not working.
    Can anyone please tell me a working example or a brief tutorial so that I can correct the logical errors in my code.
    Thanks,
    Gaurav

    Hi,
    Check whether u have uncommented the PAI and PBO modules.
    Try this one.
    REPORT ZZZTEST_3
           NO STANDARD PAGE HEADING
           MESSAGE-ID zcs_cs_001.
    1/ Report Name: ZZZ_ALV_TREE_DEMO
    The definition and implementation of the event reciever class
    include <icon>.
    Predefine a local class for event handling to allow the
    declaration of a reference variable before the class is defined.
    class lcl_event_receiver definition deferred.
    data :
         Alv Containers
         tree definition
           o_tree type ref to cl_gui_simple_tree,
         Event Handler
           o_eventreceiver     type ref to lcl_event_receiver,
           o_dockingcontainer TYPE REF TO cl_gui_docking_container.
    data :
        node structures for tree building
          i_nodes type table of abdemonode, " node table def create bespoke
          w_nodes like line of i_nodes,     " work area
          i_tree_event type cntl_simple_events, " Itab for Tree Events
          w_tree_event type cntl_simple_event.   " Work area for Tree Events
    data:
           v_ratio1            type i,     "docking container screen area
    container screen area
           v_action(12)        type c.
    Internal Tables Used for Object ALV Display.
    data:
          i_toolbar           type table of stb_button,  "Tool bar for Grid1
          i_exclude1          type ui_functions,
          i_exclude2          type ui_functions,
          i_groups            type lvc_t_sgrp,  " Group Definitions
          i_selected_rows     type lvc_t_row.   " Select row type
    constants: c_x(1)    type c value 'X',             "Checked
               c_a(1)    type c value 'A'.             "All Layouts
          CLASS lcl_event_receiver DEFINITION
    class lcl_event_receiver definition.
      event receiver definitions for ALV actions
      public section.
        class-methods:
    Status bar
           handle_user_command
            for event user_command of cl_gui_alv_grid
                importing e_ucomm,
    Tree Actions
          handle_node_double_click
            for event node_double_click of cl_gui_simple_tree
            importing node_key,
    Row Double click for dirll down.
           handle_double_click
             for event double_click of cl_gui_alv_grid
                importing e_row
                          e_column
                          es_row_no.
    endclass.
    Implementation
    Every event handler that is specified below should also be set after
    the object has been created.  This is done in the PBO processing.
    with the following command
    SET HANDLER oEventreceiver->handle_toolbar FOR o_Alvgrid.
    class lcl_event_receiver implementation.
      method handle_user_command.
    In event handler method for event USER_COMMAND: Query your
      function codes defined in step 2 and react accordingly.
      endmethod.
    *&      Method handle_double_click
    This method is called when the user double clicks on a line to drill
    down.
    The following are exported from the ALV
    LVC_S_ROW
    LVC_S_COL
    LVC_S_ROID
      method handle_double_click.
    The double click drill down processing should be
    coded in the form below.
      endmethod.
    *&      Method handle_node_double_click
    This method handles the node double click event of the tree
    LVC_S_ROW
    LVC_S_COL
    LVC_S_ROID
      method handle_node_double_click.
       perform f9903_handle_node_double_click using node_key.
      endmethod.
    endclass.
    INITIALIZATION
    INITIALIZATION.
    PERFORM f050_initialize_values.
    FORM f050_initialize_values.
      v_ratio1 = 30.  "tree size
    ENDFORM.                    "  f050_initialize_values
    START-OF-SELECTION
    START-OF-SELECTION.
    END-OF-SELECTION
    END-OF-SELECTION.
      CALL SCREEN 9001.
    *Data Selection
    FORM f9000_objects_create USING    value(pobject)
                                 pparent
                                 value(pratio)
                                 value(prows)
                                 value(pcolumns).
      CASE pobject.
        WHEN  'o_dockingcontainer'.
          IF o_dockingcontainer IS INITIAL.
            CREATE OBJECT o_dockingcontainer
              EXPORTING
               side                        = v_dock_side1
                ratio                       = pratio  "amount of screen
              EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5
                others                      = 6.
            PERFORM f9800_error_handle USING text-e06.
          ENDIF.
          WHEN 'o_tree'.
          IF o_tree IS INITIAL.
            CREATE OBJECT o_tree
             EXPORTING
            LIFETIME                    =
               parent                      = pparent
            SHELLSTYLE                  =
               node_selection_mode         = o_tree->node_sel_mode_single
            HIDE_SELECTION              =
              name                        = 'Transactions'
             EXCEPTIONS
               lifetime_error              = 1
               cntl_system_error           = 2
               create_error                = 3
                failed                     = 4
               illegal_node_selection_mode = 5
               others                      = 6.
            PERFORM f9800_error_handle USING text-e06.
          ENDIF.
        WHEN 'o_eventreceiver'.
          IF o_eventreceiver IS INITIAL.
            CREATE OBJECT o_eventreceiver.
            PERFORM f9800_error_handle USING text-e08.
          ENDIF.
        WHEN OTHERS.
       do nothing
      ENDCASE.
    ENDFORM.                    " f9000_objects_create
    *&      Form  f9100_create_tree
          Create the Tree
         -->P_O_TREE  tree data
    FORM f9100_create_tree USING p_o_tree TYPE REF TO cl_gui_simple_tree.
      REFRESH: i_nodes.
      CLEAR: w_nodes.
    Header Tree Folder
      w_nodes-node_key = 'ROOT'.
      w_nodes-isfolder = c_x.
      w_nodes-expander = c_x.
      w_nodes-text = 'Transactions'.
      APPEND w_nodes TO i_nodes.
    Adding Root Nodes for the tree.
    Key:
    NODE_KEY, RELATKEY, RELATSHIP, HIDDEN, DISABLED, ISFOLDER, N_IMAGE,
    EXP_IMAGE, STYLE, LAST_HITEM, NO_BRANCH, EXPANDER, DRAGDROPID, TEXT
      PERFORM f9101_node_list USING: '1' 'ROOT' '' '' '' c_x '' '' '' '' ''
                              c_x '' 'Sales Orders'.
    Adding subitems for the root node.
      PERFORM f9101_node_list USING:
                            Material Details
                              'VA01' '1' '' '' '' '' '@15@' '' '' '' '' ''
                              '' 'Create Sales Orders',
                            Document Details
                              'VA02' '1' '' '' '' '' '@15@' '' '' '' '' ''
                               '' 'Change Sales Orders'.
      PERFORM f9101_node_list USING: '2' 'ROOT' '' '' '' c_x '' '' '' '' ''
                              c_x '' 'Deliveries'.
    Adding subitems for the root node.
      PERFORM f9101_node_list USING:
                            Material Details
                              'VL01' '2' '' '' '' '' '@15@' '' '' '' '' ''
                              '' 'Create Outbound Delivery',
                            Document Details
                              'VL02' '2' '' '' '' '' '@15@' '' '' '' '' ''
                              '' 'Change Outbound Delivery'.
    add the nodes to the tree object,
      PERFORM f9102_add_treenodes TABLES i_nodes
                                 USING 'ABDEMONODE'  "node definition
                                        p_o_tree.       "tree declaration
    enabling event handlers for the tree
      PERFORM f9103_tree_event_handle USING p_o_tree.
    ENDFORM.                    " f9100_create_tree
    *&      Form  f9101_node_list
          Adding Nodes in a TREE
    FORM f9101_node_list USING    value(pnodekey)
                                 value(prelatkey)
                                 value(prelatship)
                                 value(phidden)
                                 value(pdisabled)
                                 value(pisfolder)
                                 value(pimage)
                                 value(pexpimage)
                                 value(pstyle)
                                 value(plastitem)
                                 value(pnobranch)
                                 value(pexpander)
                                 value(pdragdropid)
                                 value(ptext).
      w_nodes-node_key   = pnodekey.
      w_nodes-relatkey   = prelatkey.
      w_nodes-relatship  = prelatship. "Natural number
      w_nodes-hidden     = phidden.
      w_nodes-disabled   = pdisabled.
      w_nodes-isfolder   = pisfolder.
      w_nodes-n_image    =  pimage.  "Icons / embedded bitmap
      w_nodes-exp_image  = pexpimage. "Icons / embedded bitmap
      w_nodes-style      = pstyle.
      w_nodes-last_hitem = plastitem. "Tree Control: Column Name / Item
      "Name
      w_nodes-no_branch  = pnobranch.
      w_nodes-expander   = pexpander.
      w_nodes-dragdropid = pdragdropid.
      w_nodes-text       = ptext.
      APPEND w_nodes TO i_nodes.
    ENDFORM.                    " f9101_node_list
    *&      Form  f9102_add_treenodes
          Adding the Nodes to the Tree
         -->PI_NODES  Table containg the Nodes
         -->PTABLE    Name of the Table structure name
         -->PO_TREE   tree object
    FORM f9102_add_treenodes TABLES pi_nodes TYPE STANDARD TABLE
                            USING  value(ptable)
                                   po_tree TYPE REF TO cl_gui_simple_tree.
      CALL METHOD po_tree->add_nodes
        EXPORTING
          table_structure_name           = ptable    "may need to change
          node_table                     = pi_nodes[]
        EXCEPTIONS
          error_in_node_table            = 1
          failed                         = 2
          dp_error                       = 3
          table_structure_name_not_found = 4
          OTHERS                         = 5
      PERFORM f9800_error_handle USING text-e10.
    ENDFORM.                    " f9102_add_treenodes
    *&      Form  f9103_tree_event_handle
          Event Handling for Tree.
         -->P_P_O_TREE  text
    FORM f9103_tree_event_handle USING
                                p_o_tree TYPE REF TO cl_gui_simple_tree.
      w_tree_event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
      w_tree_event-appl_event = ' '. " process PAI if event occurs
      APPEND w_tree_event TO i_tree_event.
      CALL METHOD p_o_tree->set_registered_events
          EXPORTING
            events = i_tree_event
          EXCEPTIONS
            cntl_error                = 1
            cntl_system_error         = 2
            illegal_event_combination = 3.
      IF sy-subrc <> 0.
       MESSAGE A000.
      ENDIF.
      IF o_eventreceiver IS INITIAL.
        CREATE OBJECT o_eventreceiver.
      ENDIF.
      SET HANDLER o_eventreceiver->handle_node_double_click FOR p_o_tree.
    ENDFORM.                    " f9103_tree_event_handle
         -->P_IEXCLUDE  text
         -->P_1150   text
    FORM f9200_exclude_functions USING   pexclude LIKE i_exclude1
                                   value(pfunction).
      DATA: l_exclude TYPE ui_func.
      l_exclude = pfunction.
      APPEND l_exclude TO pexclude.
    ENDFORM.                    " f9200_exclude_functions
    *&      Form  f9903_handle_node_double_click
          This form is used to handle the double click event for the tree
         -->P_NODE_KEY  Node clicked.
    FORM f9903_handle_node_double_click USING  p_node_key.
      CASE p_node_key.
        WHEN 'VA01'.
         SUBMIT ZZZ_TEST AND RETURN.
         CALL TRANSACTION 'VA01'. " and skip first screen.
        WHEN 'VA02'.
          CALL TRANSACTION 'VA02'. " and skip first screen.
        WHEN 'VL01'.
          CALL TRANSACTION 'VL01'. " and skip first screen.
        WHEN 'VL02'.
          CALL TRANSACTION 'VL02'. " and skip first screen.
        WHEN OTHERS.
        do nothning.
      ENDCASE.
    ENDFORM.                    " f9903_handle_node_double_click
    *&      Form  f9700_free_objects
    This form handles the freeing of the following objects
    ALV
    Docking Container
         -->P_O_ALVGRID  text
         -->P_0020   text
         -->P_0021   text
    FORM f9700_free_objects USING pobject
                        value(ptype)
                        value(ptext).
    Need to type the field symbol or it does not work
      CASE ptype.
        WHEN 'DOCKING'.
          DATA: l_odock TYPE REF TO cl_gui_docking_container.
          l_odock = pobject.
          IF NOT ( l_odock IS INITIAL ).
            CALL METHOD l_odock->free
              EXCEPTIONS
                cntl_error        = 1
               cntl_system_error = 2
                OTHERS            = 3.
            CLEAR: pobject, l_odock.
            PERFORM f9800_error_handle USING ptext.
          ENDIF.
        WHEN 'TREE'.
          DATA: l_otree TYPE REF TO cl_gui_simple_tree.
          l_otree = pobject.
          IF NOT ( l_otree IS INITIAL ).
            CALL METHOD l_otree->free
              EXCEPTIONS
                cntl_error        = 1
               cntl_system_error  = 2
                OTHERS            = 3.
            CLEAR: pobject, l_otree.
            PERFORM f9800_error_handle USING ptext.
          ENDIF.
        WHEN OTHERS.
       do something.
      ENDCASE.
    ENDFORM.                    " f9700_free_objects
    *&      Form  f9800_error_handle
          Handles Errors
         -->P_PTEXT  text
    FORM f9800_error_handle USING    value(ptext).
      IF sy-subrc NE 0.
    add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = text-e01
                  txt2  = sy-subrc
                  txt1  = ptext.
      ENDIF.
    ENDFORM.                    " f9800_error_handle
    *PBO & PAI Modules
    *&      Module  STATUS_9001  OUTPUT
          text
    module status_9001 output.
    Set the Status Bar
      set pf-status 'Z_STATUS'.
    Set the Title
      set titlebar 'Z_TITLE'.
      perform f9000_objects_create using:
                create docking container
                  'o_dockingcontainer' '' v_ratio1 '' '',
                create a tree
                  'o_tree' o_dockingcontainer '' '' '',
                Create the event reciever
                  'o_eventreceiver' '' '' '' ''.
    Create the Tree View.
      perform f9100_create_tree using o_tree.
    endmodule.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
          text
    module user_command_9001 input.
      case sy-ucomm.
        when 'EXIT' or  'CANC'.
          perform f9700_free_objects using:
                        o_tree 'TREE' text-E03,
                        o_dockingcontainer 'DOCKING' text-E05,
                        o_eventreceiver 'EVENT' text-e09.
    leave program.
          leave.    " to SCREEN 0.
        when 'BACK'.
          perform f9700_free_objects using:
                        o_tree 'TREE' text-E03,
                        o_dockingcontainer 'DOCKING' text-e05,
                        o_eventreceiver 'EVENT' text-E09.
          set screen '0'.
          leave screen.
        when others.
      endcase.
    endmodule.                 " USER_COMMAND_9001  INPUT
    Get back to me if u have any queries. Give me ur mail id, i will send one more sample code for ALV tree. This sample program will display only Tree not grid u can add ALV grid too.
    Thanks & Regards,
    Judith.

  • ADF 10.1.3.0.4: tree leaf with no child nodes still displays folder icon?

    I was reading through Frank Nimphius's Blog and found the entry entitled "ADF Faces: Building a hierarchical tree from recursive tables - October 05, 2006" and found a tree example in which a tree leaf with no child nodes do not display the folder icon.
    I've followed the instructions listed with adf:tree, CoreTree and ChildPropertyTreeModel, but my tree leaves with no child nodes still displays the folder icon.
    How do I remove this icon when the node is a leaf with no children?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I figured it out.
    I used the ChildPropertyTreeModel.isContainer() method.
    --Todd                                                                                                                                                                                           

Maybe you are looking for

  • Transport issue in NWDI

    Hi , I am facing issue while transporting BPM project. My scenario is: I am using single SLD for Dev and Test environments. We have BPM already present on Dev and test environments. Received a new change for the existing BPM. we have undeployed the e

  • Coloring Cells in Apex 4.2

    I'm trying to figure out how to change the cell background color in an Apex report. I've tried following instructions that I've found on here and on the net with no luck. I'm wondering if maybe the instructions are not valid for 4.2. Anyway, has anyo

  • Automating sql files via a command line prompt

    Hi All I've set up an SQL file that extracts information about students in csv format. This information is then imported into another piece of software that creates students e-mail accounts etc.. The program prompts the user to specify from when they

  • I cannot access my Yahoo Email account or my Netflix account using Firefox.

    When I am in Firefox I cannot access my Yahoo! email accounts nor can I sign in to my Netflix account. These I can do in Internet Explorer (which I prefer not to use).

  • I need a display suggestion.

    I have been working on a calendar of events flex application as most anybody who monitors these flex lists probably has noticed. This is a reworking of an existing [D]HTML/CFML application. Part of the current display is that canceled events are disp