【问题标题】:Flex DateField SelectedField Always Set to NULLFlex DateField SelectedField 始终设置为 NULL
【发布时间】:2011-03-13 21:38:29
【问题描述】:

我想将 DateField 字符串格式化为“MM/YYYY”。但是,我注意到即使选择了有效日期,它的 selectedDate 属性也始终设置为 null。有人可以对此有所了解吗?

谢谢,

<mx:FormItem label="Start Date" required="true">
    <mx:DateField id="startDateField" formatString="MM-YYYY"/>
</mx:FormItem>

【问题讨论】:

    标签: apache-flex datefield


    【解决方案1】:

    在你的 dateField 上设置 parseFunction 属性。

    <mx:DateField id="startDateField" formatString="MM-YYYY" parseFunction="{null}" />
    

    我认为 formatString 与 dateField 上的 selectedDate 值混淆了。

    查看here 以获得更深入的解释。

    【讨论】:

    • 非常感谢安吉洛的回答。 Flex 有时真的很奇怪!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多