The following example shows how you can set the selected date for a Flex DateChooser control by setting the selectedDate property to a Date object.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/04/02/setting-the-selected-date-in-a-datechooser-control-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="horizontal"
verticalAlign="middle"
backgroundColor="white">
<mx:DateChooser id="dateChooser1"
selectedDate="{new Date('2008/04/19')}"
showToday="false" />
<mx:DateChooser id="dateChooser2"
initialize="dateChooser2.selectedDate = new Date('2008/04/19');"
showToday="false" />
</mx:Application>
View source is enabled in the following example.





0 Responses to “Setting the selected date in a DateChooser control in Flex”
Leave a Reply