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/07/03 11:55:33 UTC

[GitHub] [royale-asjs] nihavend opened a new issue #884: Alert box needs second click to be closed.

nihavend opened a new issue #884:
URL: https://github.com/apache/royale-asjs/issues/884


   Alert box needs second click to be closed if created within menu bar.
   
   The sample case has a button and a menu bar.
   
   ![image](https://user-images.githubusercontent.com/5983818/86466558-7feac080-bd3c-11ea-8f0f-cf34b15e2008.png)
   
   If the alert is displayed with button than it works correctly and is closed when the cancel button clicked. But if created through menu bar than needs second click on cancel to be disposed.
   
   ```
   
   <?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%" 
   			   >
   	
   	<fx:Declarations>
   		<mx:XMLListCollection id="menuBarData" source="{menuDataXMLList}"/>	
   	</fx:Declarations>	
   		
   	<fx:Script>
   		<![CDATA[
   			import mx.events.FlexEvent;
   			import mx.controls.Alert;
   			import mx.events.CloseEvent;
   			import mx.events.MenuEvent;
   			
   			private function test():void {
   				Alert.show("suspendPinaraConfirmation", "Warning !", Alert.OK|Alert.CANCEL, this, suspendApp, null, Alert.CANCEL);
   			}
   			
   			private function suspendApp(eventObj:mx.events.CloseEvent):void {
   				if(eventObj.detail == Alert.OK) {
   					trace("suspendapp");
   				}
   			}
   			
   			protected function pinaraMenuBar_creationCompleteHandler(event:FlexEvent):void
   			{
   				applyFilters();
   			}
   			
   			public function applyFilters():void {
   				// Do nothing !
   			}
   			
   			protected function tlosMenuBar_itemClickHandler(event:MenuEvent):void {
   
   				var labelTxt:String = event.item.@label;
   				
   				if (labelTxt == "Test-1") {
   					Alert.show("suspendPinaraConfirmation", "Warning !", Alert.OK|Alert.CANCEL, this, suspendApp, null, Alert.CANCEL);
   				} else if (labelTxt == "Test-1-1") {
   					Alert.show("suspendPinaraConfirmation", "Warning !", Alert.OK|Alert.CANCEL, this, suspendApp, null, Alert.CANCEL);
   				} else if (labelTxt == "Test-1-2") {
   					Alert.show("suspendPinaraConfirmation", "Warning !", Alert.OK|Alert.CANCEL, this, suspendApp, null, Alert.CANCEL);
   				}
   			}
   		]]>
   	</fx:Script>
   	
   	<fx:Declarations>
   		
   		<fx:XMLList id="menuDataXMLList">
   			<menuitem label="Test-1" id="help">			
   				<menuitem label="Test-1-1"/>			
   				<menuitem label="Test-1-2"/>			
   			</menuitem>
   		</fx:XMLList>
   		
   	</fx:Declarations>	
   	
   	<s:layout>
   		<s:VerticalLayout gap="10" paddingRight="10" paddingLeft="10" paddingTop="10" paddingBottom="20" />
   	</s:layout>
   	
   	<s:Button label="View XML" visible="true" includeInLayout="true" click="test()" />
   	
   	<mx:MenuBar id="pinaraMenuBar" width="100%"  color="#0D173C" 
   				dataProvider="{menuBarData}" fontFamily="Arial" fontWeight="bold" horizontalCenter="0"
   				itemClick="tlosMenuBar_itemClickHandler(event)" 
   				labelField="@label" 
   				creationComplete="pinaraMenuBar_creationCompleteHandler(event)"/>
   	
   </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



[GitHub] [royale-asjs] aharui closed issue #884: Alert box needs second click to be closed.

Posted by GitBox <gi...@apache.org>.
aharui closed issue #884:
URL: https://github.com/apache/royale-asjs/issues/884


   


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