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/05/09 08:49:52 UTC

[GitHub] [royale-asjs] nihavend edited a comment on issue #819: ADG inner components can not inherit data object and tooltip is not displayed

nihavend edited a comment on issue #819:
URL: https://github.com/apache/royale-asjs/issues/819#issuecomment-623089111


   @aharui 
   I am changing the test case source code to make it more clear and similar to original application. Tooltip has still bugs but I leave it for another thread and it is working for this case.
   
   Currently the two images are displayed in grid but only one has the value true for visibility which is "Enable"
   
   Note : I can share the flex original source on demand which is working as expected.
   
   live test [click](http://www.tlos.com.tr/royale_bugs/819/js-debug/)
   
   ![image](https://user-images.githubusercontent.com/5983818/80911893-dbe79780-8d41-11ea-9934-1df2072438a8.png)
   
   > FindBug.mxm
   
   ```
   <?xml version="1.0" encoding="latin5" ?>
   
   <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"
   			   height="100%" width="100%"
   			   currentState="anaSayfaState"
   			   xmlns:mtest="main.mtest.*" 
   			   creationComplete="group1_creationCompleteHandler(event)">
   
   	
   	<fx:Script>
   		<![CDATA[
   			import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
   			import mx.collections.ArrayCollection;
   			import mx.events.FlexEvent;
   			import mx.collections.XMLListCollection;
   			import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
   
   			
   			[Bindable]
   			public var jobListXmlCollection:XMLListCollection = new XMLListCollection();
   			
   			public var jobListXml:XML = 
   				<jobList netTreeEnablable="false" netTreeDisablable="false" >
   				  <genericJob  Id="1" groupId="iot-insights">
   					<baseJobInfos>
   	  					<jsName>SENSORDATA_HOURLY</jsName>
   					</baseJobInfos>
   					<visualParams>
   						<statu>0</statu>
   						<commandabilityParams>
   							<isPausable>true</isPausable>
   						  	<isResumable>false</isResumable>
   						  	<isRetryable>false</isRetryable>
   						  	<isSkipable>false</isSkipable>
   						  	<isStartable>true</isStartable>
   						  	<isStopable>false</isStopable>
   						  	<isSuccessable>false</isSuccessable>
   						  	<isDisablable>false</isDisablable>
   						  	<isEnablable>true</isEnablable>
   						</commandabilityParams>					
   					</visualParams>
   				  </genericJob>
   				</jobList>;
   			
   			protected function group1_creationCompleteHandler(event:FlexEvent):void {
   				jobListXmlCollection.source = jobListXml.children();
   			}
   
   			public function getJsName(item:XML, column:AdvancedDataGridColumn):String {
   				return item.baseJobInfos.jsName;
   			}
   
   		]]>
   	</fx:Script>
   	
   	<mx:Panel title="AdvancedDataGrid Control Example"
   			  paddingBottom="10" paddingTop="10" paddingLeft="10" paddingRight="10"
   			  height="200" width="350">
   		
   		<mx:AdvancedDataGrid id="pinaraJobList" width="100%" height="100%" dataProvider="{jobListXmlCollection}">        
     
   			<mx:columns>
   				
   				<mx:AdvancedDataGridColumn labelFunction="getJsName" headerText="Job Name" width="150"/>
   				
   				<mx:AdvancedDataGridColumn headerText="Manage" width="150">
   					<mx:itemRenderer>
   						<fx:Component>
   							<mtest:adg_custom selectedGroupId="1" /> <!--RO: {outerDocument.selectedGroupId} -->
   						</fx:Component>
   					</mx:itemRenderer>
   				</mx:AdvancedDataGridColumn>
   			
   			</mx:columns>
   			
   		</mx:AdvancedDataGrid>
   		
   	</mx:Panel>
   	
   </s:Application>
   ```
   
   
   > adg_custom.mxml
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <s:MXAdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
   					xmlns:s="library://ns.apache.org/royale/spark" 
   					clipAndEnableScrolling="true"
   					xmlns:mx="library://ns.apache.org/royale/mx" 
   					xmlns:mtest="main.mtest.*" 
   					>
   	<fx:Declarations>
   		<!-- Place non-visual elements (e.g., services, value objects) here -->
   	</fx:Declarations>
   	
   	<fx:Script>
   		<![CDATA[
   			
   			
   			[Bindable]
   			public var selectedGroupId:String;
   			
   			
   		]]>
   	</fx:Script>
   	
   	<mtest:adg_image id="manageButtonGroup" data="{data}" selectedGroupId="{selectedGroupId}" />
   	
   </s:MXAdvancedDataGridItemRenderer>
   ```
   
   > adg_image.mxml
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
   		  xmlns:s="library://ns.apache.org/royale/spark" 
   		  xmlns:mx="library://ns.apache.org/royale/mx">
   	<fx:Declarations>
   		<!-- Place non-visual elements (e.g., services, value objects) here -->
   	</fx:Declarations>
   	
   	<fx:Script>
   		<![CDATA[
   			
   			[Bindable]
   			public var data:XML;
   			
   			[Bindable]
   			public var selectedGroupId:String;	
   
   			public function executeJobCommand(event:MouseEvent, jobId:String, tlosName:String):void {
   				trace(jobId);
   				trace(tlosName);
   			}
   			
   			// {trace('XML : ' + XMLList(XML(data.stateInfos.LiveStateInfos).children())[0].StateName)}
   		]]>
   	</fx:Script>
   	
   	<s:layout>
   		<s:HorizontalLayout />
   	</s:layout>
   	
   	<s:Image id="disableJob" source="images/disableJob.jpg" toolTip="Disable" width="23" height="23" 
   			 includeInLayout="{data.visualParams.commandabilityParams.isDisablable == true}" buttonMode="true"
   			 visible="{data.visualParams.commandabilityParams.isDisablable == true}"
   			 click="executeJobCommand(event, data.@Id, data.Id)" />
   	
   	<s:Image id="enableJob" source="images/enableJob.jpg" toolTip="Enable" width="23" height="23"
   			 includeInLayout="{data.visualParams.commandabilityParams.isEnablable == true}" buttonMode="true"
   			 visible="{data.visualParams.commandabilityParams.isEnablable == true}"
   			 click="executeJobCommand(event, data.@Id, data.Id)" />
   	
   </s:Group>
   ```
   
   


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