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 converters

Converters are a completely new feature in Vaadin 7. They are used to convert between the UI and the data model type. For example, we can convert String to some other types such as Date, Integer, Boolean, or we can convert Date to Long type or we can create custom converter. They are also used as an initial validator. In this recipe, we will create a converter that converts Roman numerals to integer numbers. We will create both conversions, Roman to integer and vice versa. It will consist of text field for the Roman numeral, one button, and one label for converted value as shown in the following screenshot:

Using converters

How to do it...

  1. Create ...

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