0 Replies Latest reply on Feb 1, 2007 9:00 AM by Roman Protsiuk

    DateField and formatString

    Roman Protsiuk
      Hi, all.

      Strange behavior of DateField occurs after changing default value of
      formatString (e.g. formatString="MM/YYYY" or formatString="YYYY").
      After doing so, selectedDate property of DateField resets to null
      every time DateField loses focus.

      For example:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:DateField id="dateField" formatString="MM/YYYY" />
      <mx:Label color="blue" text="Date selected:
      {dateField.selectedDate}" />
      <mx:Button label="just to click something :)" />

      1. select some date
      2. click the button
      3. result: "Date selected: null"

      It is reset to null even when one clicks icon that pops up
      DateChooser. I guess this happens when DateField loses focus. But this
      is just a hypothesis.

      Any ideas why this happens? Solutions maybe?

      Thanks in advance,