nihavend opened a new issue #673: Tree item throws exception when close root 
node while all nodes are expended
URL: https://github.com/apache/royale-asjs/issues/673
 
 
   For the example below there are two level tree nodes as in picture below 
   
   
![image](https://user-images.githubusercontent.com/5983818/72183010-d4505b80-33fd-11ea-9d59-ba1d4b84273d.png)
   
   when click to close the root node, the exception is thrown below
   
   
![image](https://user-images.githubusercontent.com/5983818/72183074-fb0e9200-33fd-11ea-8673-582630d12419.png)
   
   After this error if you click on item, it enters in to infinite loop.
   
![image](https://user-images.githubusercontent.com/5983818/72183121-22655f00-33fe-11ea-925c-b758494b267e.png)
   the counter goes on.
   
   Here is the test code 
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                           xmlns:s="library://ns.apache.org/royale/spark"
                           xmlns:mx="library://ns.apache.org/royale/mx"
                           paddingBottom="0" paddingTop="0" paddingLeft="0" 
paddingRight="0"
                           height="100%" width="100%" 
                           creationComplete="loadData()"
                           >
        
        <fx:Metadata>
        </fx:Metadata>
        
        <fx:Script>
                <![CDATA[
                        
                        
                        [Bindable] 
                        public static var liveTreeDP:XMLList;
                        
                        import mx.events.ListEvent;
                        
                        public function loadData():void {
                                liveTreeDP = PInaraData;
                        }
                        
                        private function treeLabel(item:Object):String { 
                                
                                var node:XML = XML(item); 
                                //Alert.show(node.localName());
                                if (node.localName() == "list") {
                                        return node.@title; 
                                } else if (node.localName() == "jobGroup") {
                                        if(node.@id == "") {
                                                // Alert.show("node : " + node);
                                        }
                                        return node.@title + " [Id:" + node.@id 
+ "]"; 
                                } else if(node.localName() == "jobProperty") {
                                        //return node.@name; 
                                        if(node.@id == "") {
                                                // Alert.show("node : " + node);
                                        }
                                        return node.@title + " [Id:" + node.@id 
+ "]"; 
                                }
                                
                                return node;
                        } 
                        
                        private function 
myTree_itemClickHandler(e:ListEvent):void {
                                trace("");
                        }
                ]]>
        </fx:Script>
        
        <fx:Declarations>               
                <fx:XMLList id="PInaraData">
                        <list title="Grup Listesi" id="0">
                                <jobGroup title="Independents" id="-1">
                                        <jobProperty title="SENSORDATA_HOURLY" 
id="1" statu="0" port="1"/>
   
                                </jobGroup>
                        </list>
                </fx:XMLList>
        </fx:Declarations>      
        
        <s:layout>
                <s:VerticalLayout gap="10" paddingRight="10" paddingLeft="10" 
paddingTop="10" paddingBottom="20" />
        </s:layout>
        
        <mx:Panel title="Tree Label Function Example"
                          paddingBottom="10" paddingTop="10" paddingLeft="10" 
paddingRight="10"
                          height="50%" width="50%">
   
                        <mx:Tree id="myTree" width="50%" height="100%"
                                         labelFunction="treeLabel"
                                         labelField="@title"
                                         showRoot="true" 
dataProvider="{liveTreeDP}" 
                                         
itemClick="myTree_itemClickHandler(event)"/>
                
        </mx:Panel>
        
   </s:Application>
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to