Flex3 Air 中的验证器组件
如何在 Air 应用程序中使用必需验证器、整数验证器等验证器控件?我尝试使用它们,但收到此错误:
此处不允许组件声明。 (注意:视觉子项必须实现 mx.core.IUIComponent)
我已经像这样导入了验证器...
import mx.validators.Validator;
并像这样使用
<mx:TextArea id="txtQuestCaption" change="txtQuestCaption_change(event)"/>
<mx:Validator id="reqValidator" source="txtQuestCaption">
</mx:Validator>
但是我得到了上面的错误..
如何在空气中使用验证器?
How to use validator controls like Required validator, integer validator etc in Air application? I tried to use them but I got this error:
Component declarations are not allowed here. (Note: visual children must implement mx.core.IUIComponent)
i have imported the validator like this...
import mx.validators.Validator;
and used like this
<mx:TextArea id="txtQuestCaption" change="txtQuestCaption_change(event)"/>
<mx:Validator id="reqValidator" source="txtQuestCaption">
</mx:Validator>
But i got that above error..
how to use validator in air ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这段代码似乎嵌套在某个容器标签内。将
标记移出当前位置,并将其直接放置在根 mxml 标记内。非视觉标签(如 Validator、Style 等)应添加为根 mxml 标签的直接子代It seems that this code is nested inside some container tag. Move the
<mx:Validator/>
tag out of the current position and place it directly within the root mxml tag. Non visual tags like Validator, Style etc should be added as the immediate children of the root mxml tag