0 Replies Latest reply on Jun 4, 2007 2:50 PM by raj1399

    DateField displayedMonth displayedYear

    raj1399
      Hi

      I have the following piece of the code .
      Steps to reproduce problem.
      1.Select any date other than the today date.(select previous month and year)
      2. click the button.

      Expected result.
      Datechooser should show the current month and year.

      Actual Result:
      Datechooser shows the selected month and year.

      Please help me this.



      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:DateField id="fromDateField" showToday="true" width="100" yearNavigationEnabled="true" editable="true" top="263" left="43" />
      <mx:Button x="60" y="293" label="Button" click="changeselMonth()"/>
      <mx:Script>
      <![CDATA[
      import mx.controls.Alert;
      public function changeselMonth()
      {
      //fromDateField.selectedDate = null;
      //fromDateField.showToday = true;
      //fromDateField.selectedDate = new Date();
      //fromDateField.text = "";
      mx.controls.Alert.show( " fromDateField.displayedMonth " + fromDateField.displayedMonth
      + " fromDateField.displayedYear " + fromDateField.displayedYear);
      fromDateField.selectedDate = null;
      //fromDateField.displayedMonth = 8;
      //fromDateField.displayedYear = 2006;

      var selMonth:int = int(new Date().getMonth());
      var selYear:int = int(new Date().getFullYear());
      fromDateField.displayedMonth = selMonth;
      fromDateField.displayedYear = selYear;
      }
      ]]>
      </mx:Script>
      </mx:Application>