You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2020/02/21 13:00:18 UTC

[GitHub] [royale-asjs] nihavend opened a new issue #727: mx:Tree : itemClick event is not calling the referenced function

nihavend opened a new issue #727: mx:Tree :  itemClick event is not calling the referenced function
URL: https://github.com/apache/royale-asjs/issues/727
 
 
   The referenced function  myTree_itemClickHandler to itemClick is never called. Here is the sample 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"/>
   					<jobProperty title="SENSORDATA_DAILY" id="2" statu="0" port="1"/>
   					<jobProperty title="SENSORDATA_ALWAYSON" id="3" statu="0" port="1"/>
   					<jobProperty title="SENSORDATA_FIVE_MIN" id="4" statu="9" port="1"/>
   					<jobProperty title="PERSONAL_PROFILE_INFO" id="5" statu="9" port="1"/>
   					<jobProperty title="SENSORDATA_AVG_CONS" id="6" statu="9" 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [royale-asjs] aharui closed issue #727: mx:Tree : itemClick event is not calling the referenced function

Posted by GitBox <gi...@apache.org>.
aharui closed issue #727: mx:Tree :  itemClick event is not calling the referenced function
URL: https://github.com/apache/royale-asjs/issues/727
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services