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

Filtering items using ComboBox

When we need to filter data in the fields, we can use ComboBox. In this component, items are filtered based on the user input and loaded dynamically (lazy loading) from the server. In this recipe, we will see how to use this component. In addition, we create two bound fields. The first one will be dynamically updated according to the second field.

Filtering items using ComboBox

How to do it...

In this recipe, we will update the list of cities according to the country selected:

  1. Create a Vaadin project with a main UI class called Demo.
    public class Demo extends UI {…}
  2. We start with the Country class. In this class, we need two attributes, namely, name ...

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