在Vaadin 7中直接显示错误消息 [英] Display error messages directly in Vaadin 7

查看:129
本文介绍了在Vaadin 7中直接显示错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Vaadin开发一个网络应用程序,其中涉及大量的表单。目前,所有的屏幕都已经创建好了,我通过几个测试用户(4)运行它们来检查它们的可用性。他们都有同样的评论;当发生验证错误时,不清楚问题是什么。他们都没有想过将鼠标悬停在错误指示器上(如果他们甚至注意到指示器)以获得准确的错误信息。

我在Vaadin之书中读到,错误指示器的位置由包含组件的布局管理。但是,它似乎没有直接显示错误消息。是否有可能做到这一点(最好,而不必实现一个自定义的部件集)?

谢谢,



William

解决方案

我不认为你想到的是用vaadin的基本组件实现的。

我建议采用以下方法:在表单的默认输入组件上方创建一个默认不可见的专用标签。验证后,如果有错误,请将它们全部添加到标签的文本中并使其可见。无论如何,在导致验证错误的组件旁边显示错误可能会让您的布局变得太多。

I'm developing a web app in Vaadin, which involves a large number of forms. Currently, all the screens have been created, and I ran them past a couple of test users (4) to checkout their usability. All of them had one and the same comment; when a validation error occurred, it was not clear what the problem was. None of them thought about hovering their mouse over the error indicator (if they even noticed the indicator) to get the precise error message.

I read in the Book of Vaadin that the placement of the error indicator is managed by the layout in which the component is contained. However, it doesn't seem to say anything about directly showing the error message. Is it possible to do this (preferrably, without having to implement a custom widget set)?

Thanks,

​William

解决方案

I don't think what you have in mind is implemented with vaadin's basic components.

I suggest the following approach: create a dedicated label above the form's input components that is invisible by default. After validation, if there are errors, add them all to the label's text and make it visible. Displaying the errors right next to the component that caused the validation error would likely mess up your layout too much anyway.

这篇关于在Vaadin 7中直接显示错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆