O'Reilly logo

Learning Vaadin by Nicolas Frankel

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

Event model in Vaadin

The event model in Vaadin is twofold:

  1. Implement the Observer pattern
  2. Add an abstraction layer to the HTML/JavaScript event

In Vaadin, there are two different ways to add event routing to our objects.

Note

Note that Vaadin handles the sending of client-side browser events and firing its own events on the server side.

Standard event implementation

The first way for Vaadin to offer event routing capabilities is with an implementation based on typed event-listener pairs. Each event has a corresponding pair.

For example, in order to act on focus and blur events, Vaadin provides the following pairs:

  • BlurListener / BlurEvent
  • FocusListener / FocusEvent

Note

This design is very similar to what is done in AWT. However, there is a subtle difference ...

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