O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using field validation

People make mistakes. Therefore, we have to check the user input. The important reason for validation is to make sure the data that should be stored in the database conforms to the rules of the data model. In Vaadin, it is possible to do it in several ways. The easiest way is to use predefined validators. We can validate, for example, the length of the string or the size of values; or we can compare the string against a regular expression. In this recipe, we will create a field that will check whether the given string is a syntactically valid email address.

Using field validation

How to do it...

Carry out the following steps to learn how to use validation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required