I've encountered this annoying bug today.
When using the formatFunction attribute of DateField, when the component
looses its focus, it erases the date text field.
 
To reproduce the problem, simply execute the following code from LiveDocs,
select a date and move the focus to the other text input:
<mx:DateFormatter id="dfconv" formatString="YYYY/MM/DD"/>
<mx:Script>
<![CDATA[
private function formatDate(date:Date):String
{
        return dfconv.format(date);
} 
]]>
</mx:Script>

<mx:DateField id="df" formattingFunction="formatDate" />

<mx:TextInput />

There is a simple workaround, but it does not work all the time:
<mx:DateFormatter id="dfconv" formatString="YYYY/MM/DD"/>
<mx:Script>
<![CDATA[
private function formatDate(date:Date):String
{
        return dfconv.format(date);
}

private function onChange():void {
        df.text = formatDate(df.selectedDate);
}
]]>
</mx:Script>

<mx:DateField id="df" change="onChange()" />

<mx:TextInput />

Benoit Hediard



 
 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to