flex 4 datefield 不发送清除事件
这是我的日期字段:
<mx:DateField id="date"
formatString="DD-MM-YYYY" selectableRange="{DTselectableRange}"
change="handleChange()" editable="true" clear="dateCleared(event)"/>
我想检测清除事件,adobe ref 说:
clear 事件在用户 从列表中选择“清除”(或“删除”) 文本上下文菜单。
但 dateCleared 函数从未被调用过...我需要它,因为当用户删除它时我必须将 selectedDate 设置为 null...
请帮助我...
here is my datefield:
<mx:DateField id="date"
formatString="DD-MM-YYYY" selectableRange="{DTselectableRange}"
change="handleChange()" editable="true" clear="dateCleared(event)"/>
i want to detect clear event, adobe ref say:
clear Event is dispatched when the user
selects 'Clear' (or 'Delete') from the
text context menu.
but dateCleared function in never called...I need it beacause I have to set selectedDate to null when user delete it...
Please help me...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可以确认,当从文本内容菜单中选择“删除”时,mx.controls.DateField 不会调度
clear
事件。我也没有运气为可编辑的mx.controls.TextInput
和spark.components.TextInput
调度clear
事件。嗯....您可以做的是在
handleChange
事件侦听器中处理控件值的更改,并在那里设置您的selectedDate
值。像这样的东西:
另外,我会改变这个:
到这个
I can confirm that mx.controls.DateField does not dispatch a
clear
event when selecting "Delete" from the text content menu. I've also had no luck getting aclear
event to be dispatched for editablemx.controls.TextInput
andspark.components.TextInput
. Hmm....What you can do is handle a change in the value of the control in your
handleChange
event listener and set yourselectedDate
value there.Something like this:
Also, I would change this:
to this