Adobe Flex 中的错误/验证/工具提示
是否有任何代码或自定义选项可用于实现以下目标:
1> 当文本框中出现错误时,验证会显示该错误。 强制用户删除错误,然后才继续完成剩余的文本输入。 将鼠标焦点保持在文本框上。
我使用了内置的 mx:Validator
标记,但它不会强制用户删除错误。 相反,用户可以轻松地继续操作而无需纠正错误。
2> 当鼠标焦点移动到有错误的文本输入上时,通常显示为工具提示的错误消息是否可以保留,直到用户删除错误,而不仅仅是显示在鼠标悬停操作上?
Is there any code or custom options available to achieve the following :
1> When an error occurs in a text box, the validation shows the error. Forces the user to remove the error and only then proceed to complete remaining text inputs. KEEPS the mouse focus on the Text Box.
I have used built in mx:Validator
tags, but it does not coerce the user to remove the error. Instead, user can easily go ahead without rectifying the error.
2> Can the error message which generally appears as a tooltip when mouse focus moves over the text input with the error, REMAIN until the user removes error and not just be displayed on mouse hover action?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以自定义
工具提示
来显示您的错误
。 检查此链接进行自定义您的工具提示,在ToolTips
中显示您的错误You can customize your
ToolTips
to show yourError
. Check this link to customize your tooltip, to show your error inToolTips
对于#2,请查看 http://aralbalkan.com/1125。
不幸的是,如果您有多个/大型表单,就会很麻烦。 不幸的是,flex 没有为错误工具提示提供更多样式选项。
#1 似乎是一个糟糕的 UI 设计。 虽然除非他们输入有效信息,否则您可能不允许他们提交表单,但他们应该能够自由浏览表单并填写他们选择的信息。 只是我的观点。
For #2, check out http://aralbalkan.com/1125.
Unfortunately, it is a lot of hassle if you have multiple/large forms. It is unfortunate flex doesn't provide more styling options for the error tooltip.
#1 seems to be a bad UI design. While you may not allow them to submit a form unless they enter valid information, they should be able to navigate around the form freely and fill in the information as they choose. Just my opinion.
问题1)的解决方案如下;
在允许提交表单之前,使用 Validator.validateAll 静态方法检查所有表单项是否有效。 以下片段取自一个很好的 Flex 示例,该示例显示了
完整的示例在这里
http://idletogether.com /easy-form-validation-and-submit-button-enable-disable-in-flex-3/
A solution to question 1) is as follows;
Use the Validator.validateAll static method to check that all form items are valid before allowing the form to be submitted. The following snippet is taken from a good flex example which shows this
The complete example is here
http://idletogether.com/easy-form-validation-and-submit-button-enable-disable-in-flex-3/