[ 
https://issues.apache.org/jira/browse/FLEX-34016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13857200#comment-13857200
 ] 

Justin Mclean edited comment on FLEX-34016 at 12/27/13 12:36 AM:
-----------------------------------------------------------------

For the popup to be remove you need to add a close handler when the date is 
selected like so:

{code}
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
                           xmlns:s="library://ns.adobe.com/flex/spark" 
                           xmlns:mx="library://ns.adobe.com/flex/mx" 
                           minWidth="955" minHeight="600">
        <fx:Script>
                <![CDATA[
                        import mx.controls.DateChooser;
                        import mx.events.CalendarLayoutChangeEvent;
                        import mx.managers.PopUpManager;
                        
                        private var dc:DateChooser;
                        
                        public function openChooser(event:MouseEvent):void {
                                dc = new DateChooser();
                                dc.yearNavigationEnabled = true;
                                PopUpManager.addPopUp(dc,this,true);
                                PopUpManager.centerPopUp(dc);
                                focusManager.setFocus(dc); 
                                
dc.addEventListener(CalendarLayoutChangeEvent.CHANGE, closeChooser);
                        }
                        
                        public function 
closeChooser(event:CalendarLayoutChangeEvent):void {
                                PopUpManager.removePopUp(dc);
                        }
                ]]>
        </fx:Script>
        
        <mx:LinkButton id="lb" label="choose a date" click="openChooser(event)" 
/>
</s:Application>
{code}


was (Author: jmclean):
For the popup to be remove you need to add a close handler when the date is 
selected like so:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
                           xmlns:s="library://ns.adobe.com/flex/spark" 
                           xmlns:mx="library://ns.adobe.com/flex/mx" 
                           minWidth="955" minHeight="600">
        <fx:Script>
                <![CDATA[
                        import mx.controls.DateChooser;
                        import mx.events.CalendarLayoutChangeEvent;
                        import mx.managers.PopUpManager;
                        
                        private var dc:DateChooser;
                        
                        public function openChooser(event:MouseEvent):void {
                                dc = new DateChooser();
                                dc.yearNavigationEnabled = true;
                                PopUpManager.addPopUp(dc,this,true);
                                PopUpManager.centerPopUp(dc);
                                focusManager.setFocus(dc); 
                                
dc.addEventListener(CalendarLayoutChangeEvent.CHANGE, closeChooser);
                        }
                        
                        public function 
closeChooser(event:CalendarLayoutChangeEvent):void {
                                PopUpManager.removePopUp(dc);
                        }
                ]]>
        </fx:Script>
        
        <mx:LinkButton id="lb" label="choose a date" click="openChooser(event)" 
/>
</s:Application>

> mx DateChooser freezes on any input when rendered in modal popup
> ----------------------------------------------------------------
>
>                 Key: FLEX-34016
>                 URL: https://issues.apache.org/jira/browse/FLEX-34016
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: DateChooser
>    Affects Versions: Apache Flex 4.11.0
>         Environment: Adobe FlashBuilder 4.6 on Windows 7 w/ SDK 4.11.0
>            Reporter: Alan Holden
>            Assignee: Justin Mclean
>            Priority: Critical
>
> Compile and run this application pasted below in debug mode. Click on any 
> control in the DateChooser popup and freeze the application. Change 'modal' 
> param in addPopUp function to false; and application will not freeze. Scratch 
> head, then possibly address?
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
>                          xmlns:s="library://ns.adobe.com/flex/spark" 
>                          xmlns:mx="library://ns.adobe.com/flex/mx" 
>                          minWidth="955" minHeight="600">
>       <fx:Script>
>               <![CDATA[
>                       import mx.controls.DateChooser;
>                       import mx.managers.PopUpManager;
>                       
>                       private var dc:DateChooser;
>                       public function openChooser(event:MouseEvent):void {
>                               dc = new DateChooser();
>                               dc.yearNavigationEnabled = true;
>                               PopUpManager.addPopUp(dc,this,true);
>                               PopUpManager.centerPopUp(dc);
>                               focusManager.setFocus(dc); 
>                       }
>               ]]>
>       </fx:Script>
>       
>       <mx:LinkButton id="lb" label="choose a date" click="openChooser(event)" 
> />
> </s:Application>



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to