You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Manik Magar <ma...@gmail.com> on 2012/04/05 01:52:09 UTC
DateField selectedDate and text issue
Hi All,
While working with DateField, I observed below behavior, is it a bug? If
yes, should be it be logged to Apache JIRA or Adobe bug database and Can I
put a fix for it in SDK?
Assume a Datefield added on some application -
<s:DateField id="dt"/>
on some button click i have below code -
dt.selectedDate = new Date();
Alert.show(dt.selectedDate); ---- This alerts todays date
Alert.show(dt.text); ---- alerts todays date
dt.text = "";
Alert.show(dt.text); ---- alerts ""
Alert.show(dt.selectedDate); ---- This still alerts todays date.
Now, if you open a datefield in front end to select a date, selectedDate
gets reset to NULL because text is set to "".
text will reset to "" if selectedDate is set to null, then why not
vice-versa?
Shouldn't this happen as soon as you set text = ""?
-- MM
Re: DateField selectedDate and text issue
Posted by Alex Harui <ah...@adobe.com>.
On 4/4/12 4:52 PM, "Manik Magar" <ma...@gmail.com> wrote:
> Hi All,
>
> While working with DateField, I observed below behavior, is it a bug? If
> yes, should be it be logged to Apache JIRA or Adobe bug database and Can I
> put a fix for it in SDK?
>
>
> Assume a Datefield added on some application -
>
> <s:DateField id="dt"/>
>
>
> on some button click i have below code -
>
> dt.selectedDate = new Date();
> Alert.show(dt.selectedDate); ---- This alerts todays date
> Alert.show(dt.text); ---- alerts todays date
>
> dt.text = "";
>
> Alert.show(dt.text); ---- alerts ""
> Alert.show(dt.selectedDate); ---- This still alerts todays date.
>
>
> Now, if you open a datefield in front end to select a date, selectedDate
> gets reset to NULL because text is set to "".
> text will reset to "" if selectedDate is set to null, then why not
> vice-versa?
>
> Shouldn't this happen as soon as you set text = ""?
>
>
>
> -- MM
That is expected behavior because most components use invalidation.
Changing a property programmatically isn't guaranteed to change computed
properties without time to validate or a call to validateNow().
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui