Handling Errors vaadin applications

Handling Errors- Vaadin Applications

Handling Errors is very important in every application.This ensures that the application runs smoothly and users are notified incase  the data they submit is not valid.For example,think of a field where the user is required to enter a email,if he/she adds firstname,the application should notify the user error made.

Handling Errors ensures data integrity and validity.Handling Errors in vaadin application can be done by using built in functions added in a components.This can be declared by setting component error

Handling Errors

1.Error indicator and Message

Run below code in your eclipse IDE.

After running above code,You should be able to see result in the captioned image below.

Handling Errors vaadin applications

Above code introduces some very new methods.setComponentError( new UserError(“Must be letters”)) method is responsible for displaying error when the user enters other characters that are not letters or numbers.

Forms in Vaadin have a special way of displaying errors.The fields in the form all have error indicator field and also a special message in a error indicator area.

previous next

About the Author: Eric K

Kenyan Developer and Blogger with Interests in Java,Javascript,Node.js, Wordpress, Android, PHP and Making Money Online. Solving world problems through programming is my passion. Hire me: Email : kawi3462@gmail.com