2 Replies Latest reply on Jul 8, 2006 7:52 AM by ddanone

    mx:DateField and selectableRange property

    ddanone
      Why it does not work?

      [Bindable]
      public var datRange:Object;

      public function init():void{
      datRange.rangeStart=new Date(2006,3,1);
      datRange.rangeEnd=new Date(2006,11,1);
      }
      ...
      ...
      <mx:DateField id="fenac" selectableRange="{datRange}"/>

      Thanks in advance
        • 1. Re: mx:DateField and selectableRange property
          inlineblue Level 1
          Maybe you just left it out in your post, but you didn't instantiate datRange. But it's probably a binding issue. A binding to an Object triggers only when the entire object is assigned, not when its properties change. So your init() should look something like this:

          public function init():void{
          var range: Object = new Object();
          range.rangeStart=new Date(2006,3,1);
          range.rangeEnd=new Date(2006,11,1);
          datRange = range; //Triggers binding
          }
          • 2. mx:DateField and selectableRange property
            ddanone Level 1
            Thats right, works fine.
            Thanks


            [Bindable]
            public var datRange:Object;

            public function init():void{
            var range: Object = new Object();
            range.rangeStart=new Date(2006,3,1);
            range.rangeEnd=new Date(2006,11,1);
            datRange = range; //Triggers binding
            }
            ...
            ...
            <mx:DateField id="fenac" selectableRange="{datRange}"/>