I didn't run the code, but by looking at it, the selectableRange is
bound to a plain old object which doesn't support binding. You should
have seen a warning in the console at runtime.  Thus at init time, the
selectableRange is bogus and the displayedMonth/Year probably get
screwed up as well.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of rleuthold
Sent: Sunday, May 18, 2008 8:10 AM
To: [email protected]
Subject: [flexcoders] Re: DateChooser setting displayedMonth,
displayedYear does nothing



Hi Alex, thanks for the reply. I made a simple test case, and could
figure out why it is not 
working as expected- Can you shortly have look at this code:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " 
creationComplete="build()">
<mx:Script>
<![CDATA[

[Bindable]
private var _rangeStart:Date;
[Bindable]
private var _rangeStart_two:Date = new Date(2006,0,1);
[Bindable]
private var _rangeEnd:Date;
[Bindable]
private var _rangeEnd_two:Date = new Date(2007,0,1);

private function build():void 
{
_rangeStart = new Date(2006,0,1);
_rangeEnd = new Date(2007,0,1);
}

]]>
</mx:Script>

<mx:Label text="Dates set in creation complete handler: doesn't work for
me" />
<mx:DateChooser
selectableRange="{{rangeStart : _rangeStart, rangeEnd :_rangeEnd}}"
displayedMonth="10"
displayedYear="2006"
/> 

<mx:Label text="Dates set initially: works for me" />
<mx:DateChooser
selectableRange="{{rangeStart : _rangeStart_two, rangeEnd
:_rangeEnd_two}}"
displayedMonth="10"
displayedYear="2006"
/> 

</mx:Application>

Is that explainable ?

Thank's _rico

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> I'd make a simple test case and see if it works there. Are you sure
> your compDateRange has two elements with valid values?
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of rleuthold
> Sent: Saturday, May 17, 2008 6:05 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] DateChooser setting displayedMonth,
displayedYear
> does nothing
> 
> 
> 
> Hi,
> 
> I have a DateChooser in a popUp window. If I set the displayedMonth
and
> displayedYear 
> properties on that DateChooser (after creating the popup), nothing
> happens. The display is 
> still on the month and year previously selected/displayed. Does
anybody
> have an idea ?
> 
> code (parent comp):
> 
> _datePickerWin =
> DateRangerPopUp(PopUpManager.createPopUp(Application.application as 
> DisplayObject, DateRangerPopUp, true));
> _datePickerWin.compDateRange = _dateRange;
> 
> code (DateRangerPopup):
> public function set compDateRange(dateRange:Array):void
> {
> _compDateRange = dateRange;
> 
> dateChooser.selectedRanges = [ {rangeStart: _compDateRange[0],
rangeEnd:
> 
> _compDateRange[1] }];
> 
> dateChooser.displayedMonth = _compDateRange[1].month;
> dateChooser.displayedYear = _compDateRange[1].fullYear;
> 
> 
> Thank's rico
>



 

Reply via email to