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"/>

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.

  • 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.

  • 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

  • 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

  • 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

  • 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

  • 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

  • Add a button to the branch/root in a Flex Tree

    Can someone provide me code or  guide me how to  add a button to all nodes that has children/leaf( but not  to leaf). I tried from the example in this link
    http://www.remwebdevelopment.com/dev/a31/Flex-Checkbox-TreeItemRenderer.html , but I ma getting buttons for all the nodes(including leaf).
    i need to hav ethe button on the rideside corners horizontally to all branches/root.
    Please correct me where i am wrong or provide me correct code. Thanks in advance
    package  
    PKG{
    import mx.controls.Button;  
    import mx.controls.Tree;  
    import mx.controls.treeClasses.TreeItemRenderer;  
    import mx.controls.treeClasses.TreeListData;  
    public class TreeData extends TreeItemRenderer{
    private var bWidth:Number = 30;  
    private var bHeight:Number = 20;  
    public function TreeData(){
    super();}
    var btn:Button=new Button();  
    override protected function createChildren():void{
    //addChild(btn);
    super.createChildren();}
    override public function set data(value:Object):void{
    super.data = value;  
    // get the tree that owns us  
    var _tree:Tree = Tree(this.parent.parent);  
    // if the current node is a branch node  
    //for each(item:Object in  
    if(TreeListData(super.listData).depth=1)                             -or if(TreeListData(super.listData).hasChildren)   these are not working for me{
    btn.width = bWidth;
    btn.height= bHeight;
    btn.label=
    "Remove Attachment";btn.right=10;
    else{
    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ 
    super.updateDisplayList(unscaledWidth,unscaledHeight); 
    if(super.data){ 
    var tld:TreeListData = TreeListData(super.listData); 
    // if the current node is a branch node  
    if(TreeListData(super.listData).depth=1){
    this.btn.visible=true; 
    this.btn.x=200; 
    this.btn.y = super.label.y+4; 
    //super.label.x = this.btn.x +; 
    //this.btn.y = super.label.y+8; 
    else{
    this.btn.visible=false; 
    this.btn.includeInLayout=false;}

    Hi Albert.
    You need to do a few things for that :
    - Create your own GUI status by copying STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN.
    - Set your own PF-Status using the Exclude table because otherwise your exclude table would become meaningless.
    - define a subroutine to handle the user commands.
    Sample implementation :
    FORM pf_status USING extab TYPE slis_t_extab.
      extab = pf_exclude.   
      SET PF-STATUS 'STANDARD' EXCLUDING extab.       
    ENDFORM.                    "PF_STATUS
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'PF_STATUS'
          is_layout                = layout
          it_fieldcat              = fieldcat
          it_excluding             = pf_exclude
        TABLES
          t_outtab                 = itab
        EXCEPTIONS
          OTHERS                   = 0.
            FORM user_command  USING r_ucomm LIKE sy-ucomm
                                       rs_selfield TYPE slis_selfield.
    ENDFORM.
    Please reward points if found helpful.

  • Flex tree control expanditem dynamically..?

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

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

  • Flex Tree component qestion.

    Hi, this might be a piece of cake for you guys. But I could not figure out how to expand the tree by default when you bring up your app.
    Thanks.
    K

    Set openItems
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Flex Tree does not selecting (highlight) the selectedIndices

    have an array of items that should be selected in my tree control. As you can see from my code below,I bind this array to the selectedIndices property of the tree. The selectedItems are not properly selecting in tree(selecting some other items and always root is selected).Flex seems to "ignore" my items (highlights some other indices). Am I missing something?
    Perhaps I'm going about this in wrong way?
    Thanks for your help!
    My XMLList:-
    <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <fx:XMLList id="XMLList">
            <node>
                <node name="max">
                    <node name="Emanuele"
                          surname="Tatti" age="23" wage="1200"/>
                    <node name="Francesco"
                          surname="Rapana " age="22" wage="1000"/>
                    <node name="Constantin"
                          surname="Moldovanu" age="23" wage="1200"/>
                    <node name="Marco"
                          surname="Casario" age="29" wage="1500">
                        <node name="Marco"
                              surname="Casario" age="29" wage="1500">
                            <node name="Marco"
                                  surname="Casario" age="29" wage="1500">
                                <node name="Marco"
                                      surname="Casario" age="29" wage="1500">
                                </node>
                            </node>
                        </node>                
                    </node>
                </node>
            </node>
            </fx:XMLList>
    </fx:Declarations>
    My Action Script Function:-
    public function select_tree():Void
    tree.validateNow();
    var allItems:Array = new Array();
    for(var n:Int =2;n<7;n+2)      
            allItems[n]=n; // o/p- 2,4,6
    tree.selectedIndices = allItems1;   //2,4,6 items should select ,but 0,2,4,5 are selected why?
    *****My MXML:-*****
    <mx:Button id="btn" label="Find Unmatch Nodes" width="221" height="30" click="select_tree()"/>
    <mx:Tree id="tree"  right="10" top="54" bottom="10" width="49.5%" dataProvider="{XMLList}"
        fontFamily="Verdana" fontSize="11" showScrollTips="true"
        allowMultipleSelection="true"
        alternatingItemColors="[#F5F5F5]"
        labelField="@label" selectionColor="#ECF335" showRoot="false"/>

    Are the nodes open to “expose” the children?

  • Flex Tree Folder/File Leaf/Branch icons

    Hello Everyone ,
      I have an object which implements ITreeDataDescriptor and I stuff the objects into a Tree.  The objects are being shown in the tree , however  , they are all shown with the folder icon.  Is there a way I can tell this tree that some things should be represented by folders and that others should be represented by files ?  I have attached the disastrous code.  It has everything you need to see the damage. In the xml , the nodes are either labeled "Directory" , "Topdirectory" or "File"
    P.S
    For some reason the adobe flex forum wont let me attach ... Flex files ?  Here is the FileModel that implements the ITreeDataDescriptor and the tree mxml
    Tree mxml
    <mx:Tree id="Tree" itemClick="{thingClicked(event)}" labelField="name" width="100%" height="100%" dataProvider="{collection}" />
    FileModel.as
    package {
        import flash.events.EventDispatcher;
        import flash.events.IEventDispatcher;
        import mx.collections.ArrayCollection;
        import mx.collections.ICollectionView;
        import mx.controls.treeClasses.ITreeDataDescriptor;
        import mx.core.IUID;
        public class FileModel extends EventDispatcher implements ITreeDataDescriptor, IUID
            public var userId:String;
            public var name:String;
            public var fileId:String;
            public var parentId:String;
            public var modified:String;
            public var description:String;
            public var type:String;
            public var children:ArrayCollection;
            public function FileModel(target:IEventDispatcher=null)
                super(target);
                children = new ArrayCollection();
            public function getChildren(node:Object, model:Object=null):ICollectionView
                return children;
            public function hasChildren(node:Object, model:Object=null):Boolean
                if(children.length > 0)
                {return true;}
                else
                {return false;}
            public function isBranch(node:Object, model:Object=null):Boolean
                 if(type == "DIRECTORY" || type=="TOPDIRECTORY")
                {return true;}
                else
                {return false;}
            public function getData(node:Object, model:Object=null):Object
                return this;
            public function addChildAt(parent:Object, newChild:Object, index:int, model:Object=null):Boolean
                return false;
            public function removeChildAt(parent:Object, child:Object, index:int, model:Object=null):Boolean
                return false;
            public function get uid():String
                return fileId;
            public function set uid(value:String):void
            public function addChild(childModel:FileModel):void
                children.addItem(childModel);

    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.

  • Populate flex tree control on demand using HTTPService (Flex 3)

    First, I am sorry if the same post is already posted here but after spending 30 minutes or may be more I could not find the solution.
    By the way I have two problems. 1.) I am new to flex which I know if my own problem and soon I will handle it.
    2.) This is major problem for me. I have to populate Tree control from database and I used HTTPService to get the data from database.
    I created a object of HTTPService and on load of Tree control I am calling a function which calls the HTTP URL and returns me the first level of node for my Tree.
    When I click on any node a function is called again using HTTPService and result is appended to the currently selected node. The same goes until n level and it works fine. I was happy with my results. I am stuck in new problem. The problem is if the tree is already populated on my browser and I make some add/update/delete any node or child node, the flex doesn't make a call to HTTP URL and I am not getting updated data.
    The mxml code is below (this code has some extra things too).
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical"  backgroundGradientAlphas="[1.0, 1.0]"
    backgroundGradientColors="[#000000, #868686]" >
    <mx:Script>
      <![CDATA[
       import mx.utils.StringUtil;
       import mx.rpc.http.HTTPService;
       import mx.events.ListEvent;
       import mx.binding.utils.BindingUtils;
       import mx.controls.Alert;
       import mx.rpc.events.FaultEvent;
       import mx.collections.XMLListCollection;
       import mx.utils.ObjectProxy;
       import mx.collections.ArrayCollection;
       import mx.rpc.events.ResultEvent;
       import mx.utils.ArrayUtil;
       [Bindable]
       public var datalist:XMLListCollection = new XMLListCollection();
       [Bindable]
       public var xmlFromDatabase:HTTPService=new HTTPService();
       [Bindable]
       private var xmlForChildren:HTTPService;
       private function resultHandler( event:ResultEvent ):void
           var x:XML = event.result as XML;   
           var xl:XMLList = XMLList( x );
       private function faultHandler( event:FaultEvent ):void
        Alert.show(event.message.toString());
       private function display():void
        var params:Object = {};
        params["parent"] = "0";
        xmlFromDatabase.url = "http://localhost:8080/GrailsFlex/department/tree";
        xmlFromDatabase.method = "GET";
        xmlFromDatabase.resultFormat = "e4x";
        xmlFromDatabase.useProxy = false;
        xmlFromDatabase.send(params);
        xmlFromDatabase.addEventListener(ResultEvent.RESULT,displyTree,false,0,false);
       private function displyTree(event:ResultEvent):void
        XMLtree1.dataProvider =  event.result;
        XMLtree1.labelField = "@name";
       private function getChilds(event:ListEvent):void
        try
         var xmlTree:Tree = event.currentTarget as Tree;
         var node:XML = xmlTree.selectedItem as XML
         var params:Object = {};
         params["parent"] = node.@id;
         xmlForChildren = new HTTPService();
         xmlForChildren.url = "http://localhost:8080/GrailsFlex/department/tree";
         xmlForChildren.method = "GET";
         xmlForChildren.resultFormat = "e4x";
         xmlForChildren.useProxy = false;
         xmlForChildren.send(params);
         xmlForChildren.addEventListener(ResultEvent.RESULT,appendChild,false,0,false);
         xmlForChildren.addEventListener(ListEvent.ITEM_CLICK,getChilds,false,0,false);
        catch (E:Error)
         Alert.show("getChilds Error:-- " + E.message);
       private function deleteTreeNode(xmlItem:XML):void
        var xmlParent:XML = XML(xmlItem).parent();
        if (xmlParent.@parent == null || StringUtil.trim(xmlParent.@parent) == "")
         xmlParent.@parent = "0";
        if (xmlParent.@parent != "0")
         //Recursive call until I get reach to children of root node
         deleteTreeNode(xmlParent);
        else
         // Now I am at root.
         var xmlRoot:XML = XML(xmlParent).parent();
         var bActualRoot:Boolean = false;
         if (xmlRoot == null)
          xmlRoot = xmlParent;
          bActualRoot = true;
         if (bActualRoot)
          if (xmlRoot.@parent == "0")
           try
            for each (var xl:XML in xmlParent.children())
             if (xl.@name != xmlItem.@name)
              for (var cn:int=xl.children().length()-1; cn >=0; cn--)
               delete xl.children()[cn];
           catch (ex:Error)
            Alert.show("error Real Root: " + ex.toString());
         else
          for each (var nodexm:XML in xmlRoot.children() )
           if (nodexm.@name != xmlParent.@name )
            try
             for (var cu:int=nodexm.children().length()-1; cu >=0; cu--)
              delete nodexm.children()[cu];
            catch (ex:Error)
             Alert.show("error No Real Root: " + ex.toString());
       private function appendChild(event:ResultEvent):void
        var node:XML = event.result as XML
        var sItem: XML = XMLtree1.selectedItem as XML;
        if (sItem.children().length() > 0)
         delete sItem.children();
        for(var i:int=0; i < node.children().length(); i++)
                        var item:XML = node.children()[i];
                        XMLtree1.selectedItem.appendChild(item);
                        XMLtree1.expandItem(XMLtree1.selectedItem,true,true);
        deleteTreeNode(XML(XMLtree1.selectedItem));
      ]]>
    </mx:Script>
    <mx:Tree id="XMLtree1" width="350" height="470"
          showRoot="false" creationComplete="display()" itemClick="getChilds(event)"  />
    </mx:Application>
    Thanks in advance

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

Maybe you are looking for

  • Automatic creation of customer from BP  - How to match the fields? CVI

    I am trying to create a customer from a BP. I am done all the customizing steps. Now I need to match the fields. There is an error message with this field KNA1-SPRAS that doenst match what should I do? I have read this "In particular you have matched

  • Change of sign while extracting data using Open hub

    Hello All, We are extracting data from Info cube to a file in the application server using Open hub. While extracting data, if there is any negative value for the key figure, negative sign is appending on the right side of the value(Eg: "123.67-"), w

  • How to install sap licensce? and orcle licensce ?

    hi friends i have to install sap licensce in sap ecc 6.0 and solman. how to get it from the marketplace  we buyed sap licensce . how to login from which client and which user ? how to install the orcle licensce to my data base ? please suggest me asa

  • How to active all funcationality in CC01

    Dear Guru,                 How activate all funcationality in Tcode-CC01 i.e. date that can activate from effectivity type but how to activate Flag (Green & Black white), document tab as shown in sales order i.e document flow is there any configurati

  • Deploy SCOM 2012 R2 Agents to Domain Servers on Perimeter Network using SCOM Gateway on different Domain

    Hi, I have a bit odd situation on a SCOM 2012R2 deployment. I have a MS on the internal network, and a Gateway Server on the perimeter network. Each server is connected to different Active Directory Forests and there are no trust relationships betwee