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

Justin Mclean commented on FLEX-23464:
--------------------------------------

Confirmed still an issue in Apache Flex 4.9.1
                
> Setting selectedDate in closed handler of DateField doesn't update 
> selectedDate
> -------------------------------------------------------------------------------
>
>                 Key: FLEX-23464
>                 URL: https://issues.apache.org/jira/browse/FLEX-23464
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: DateField
>    Affects Versions: Adobe Flex SDK 3.5 (Release)
>         Environment: Affected OS(s): Windows
> Affected OS(s): Windows XP
> Browser: Internet Explorer 7.x
> Language Found: English
>            Reporter: Adobe JIRA
>
>       Steps to reproduce:
> 1. Run attached example (or create your own example, being: datefield with 
> closed handler, inside the closed handler overwrite the selectedDate of the 
> datefield).
> 2. Click the DateField and select a date (when using attached example: 
> selected date not being today)
> 3. See that the SelectedDate from the closed handler doesn't get reflected
>  
>  Actual Results:
>  The date set in the closed handler is not set to the date field. The date 
> from the handler is only used when the date chooser is opened and no date is 
> selected (click outside the date chooser).
>  The handler is called both times.
>  
>  Expected Results:
>  The date set in the closed handler to be reflected in the date field.
>  
>  Workaround (if any):
> Add a "validateNow()" call after setting the selectedDate:
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
>     
>     <mx:Script>
>         <![CDATA[
>             private function myDateClosed(evt:Event):void {
>                 trace('myDateClosed(event)');
>                 myDate.selectedDate = new Date();
>                 myDate.validateNow(); /* workaround */
>             }
>         ]]
>       >
>     </mx:Script>
>     
>     <mx:ApplicationControlBar dock="true">
>         <mx:Label id="sdkVer" initialize="sdkVer.text = 
> mx_internal::VERSION;" />
>     </mx:ApplicationControlBar>
>     
>     <mx:DateField id="myDate" close="myDateClosed(event);" />
>     
> </mx:Application>
>     

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

Reply via email to