当我使用 Adobe Flex 有多个输入字段时,如何显示错误消息?
我是 Flex 开发的初学者(所以在回答时请记住这一点),我有一个 Adobe Flex 表单,其中有许多输入字段。我使用VBox、HBox作为容器来布局页面。
所以问题是:当我使用 Adobe Flex 有多个输入字段时,如何显示错误消息?当我有许多具有绝对位置的输入字段时,我应该怎么做才能显示错误消息?
网络上有关于它的好资源吗?
好的答案将获得UPvoting的
问候,
I am a beginner to Flex development (so keep it in mind when answering) and i have a Adobe Flex form in which it has many input Field. I use VBox, HBox as container to layout the page.
So the question is: How do i display error messages when i have many input fields by using Adobe Flex ? And what should i do to show error message when i have many input Field with absolute position ?
There are good resources about it in web ?
Good answers will gain UPvoting
regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简而言之,您应该使用 Validator 类(即 StringValidator)来验证各个字段的输入。您最终将为每个输入提供一个验证器。 Flex 输入内置错误消息显示和突出显示无效输入。
http://www.adobe.com/devnet/flex/quickstart/validating_data/< /a>
这是我的一篇博客文章,概述了我使用的方法:
http://joelhooks.com /2009/02/01/form-validation-for-the-lazy-programmer-in-flex/
这是利用 Hamcrest-AS3 的更高级的方法:
http://www.insideria.com/2009/ 11/validation-in-flex-with-hamcre.html
The short answer is that you should use the Validator classes (ie StringValidator) to validate the input on the individual fields. You will end up with a Validator for each input. Flex inputs have built in display of error messages and highlighting to display invalid inputs.
http://www.adobe.com/devnet/flex/quickstart/validating_data/
Here's a blog post of mine that outlines the method I use:
http://joelhooks.com/2009/02/01/form-validation-for-the-lazy-programmer-in-flex/
Here's a somewhat more advanced approach utilizing Hamcrest-AS3:
http://www.insideria.com/2009/11/validation-in-flex-with-hamcre.html