You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Justin Mclean (JIRA)" <ji...@apache.org> on 2013/05/14 04:51:15 UTC

[jira] [Updated] (FLEX-23735) dispatching ValidationResultEvent does not work

     [ https://issues.apache.org/jira/browse/FLEX-23735?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Mclean updated FLEX-23735:
---------------------------------

    Labels: easytest  (was: )
    
> dispatching ValidationResultEvent does not work
> -----------------------------------------------
>
>                 Key: FLEX-23735
>                 URL: https://issues.apache.org/jira/browse/FLEX-23735
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Events
>    Affects Versions: Adobe Flex SDK 4.0 (Release)
>         Environment: Affected OS(s): Windows
> Affected OS(s): Windows 7
> Language Found: English
>            Reporter: Adobe JIRA
>              Labels: easytest
>
>       Steps to reproduce:
> 1. compile the component bellow:
> <?xml version="1.0" encoding="utf-8"?>
> <s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009"
> 					xmlns:s="library://ns.adobe.com/flex/spark"
> 					xmlns:mx="library://ns.adobe.com/flex/mx"
> 					width="400"
> 					height="300"
> 					creationComplete="navigatorcontent1_creationCompleteHandler(event)">
> 	<fx:Script>
> 		<![CDATA[
> 			import mx.events.FlexEvent;
> 			import mx.events.ValidationResultEvent;
> 			protected function navigatorcontent1_creationCompleteHandler(event:FlexEvent):void {
> 				dispatchEvent(new ValidationResultEvent(ValidationResultEvent.INVALID));
> 			}
> 		]]
>       >
> 	</fx:Script>
> 	<fx:Declarations>
> 		<!-- Place non-visual elements (e.g., services, value objects) here -->
> 	</fx:Declarations>
> </s:NavigatorContent>
> 2. add it in a ViewStack
> 3. Run the application in AIR
>  
>  Actual Results: Error -
> [SWF] MainWindow.swf - 5,579,465 bytes after decompression
> TypeError: Error #1034: Type Coercion failed: cannot convert mx.events::ValidationResultEvent@ece6fc9 to mx.events.FlexEvent.
> 	at flash.events::EventDispatcher/dispatchEventFunction()
> 	at flash.events::EventDispatcher/dispatchEvent()
> 	at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:12266]
> 	at br.com.revelacaovirtual.envelope::NavigatorTest/navigatorcontent1_creationCompleteHandler()[D:\FlexWorkspace\RVClientFlexLib\src\br\com\revelacaovirtual\envelope\NavigatorTest.mxml:14]
> 	at br.com.revelacaovirtual.envelope::NavigatorTest/___NavigatorTest_NavigatorContent1_creationComplete()[D:\FlexWorkspace\RVClientFlexLib\src\br\com\revelacaovirtual\envelope\NavigatorTest.mxml:7]
> 	at flash.events::EventDispatcher/dispatchEventFunction()
> 	at flash.events::EventDispatcher/dispatchEvent()
> 	at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:12266]
> 	at mx.core::UIComponent/set initialized()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1577]
> 	at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:759]
> 	at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072]
>  
>  
>  Expected Results: No error
>  
>  
>  Workaround (if any): The error happens in  
> override public function dispatchEvent(event:Event):Boolean
>     {
>         if (dispatchEventHook != null)
>             dispatchEventHook(event, this);
>         return super.dispatchEvent(event);
>     }
>  
>  From UIComponent, in super.dispatchEvent(event). Once It´s not possible see the method in superclass, I could not make a deep investigation. It seems the method want a FlexEvent instead of an Event, the super class of ValidationResultEvent. Maybe just changing the superclass could sover the issue.
>     

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira