Blog

Vaadin 8.2 comes with improvements to Binder, Navigator, Grid, and Tree

By  
Matti Tahvonen
Matti Tahvonen
·
On Nov 23, 2017 10:50:00 AM
·

Although there is currently a lot of buzz around the upcoming Vaadin 10 and Flow, we continue to work with improvements to the Vaadin 8 series, as well. In fact, specific features are developed or improved in the 8 series and then the changes will later be applied to Vaadin Flow. Also, the community has lately been really active proposing new features and bug fixes via GitHub, so we have a quite substantial 8.2 release coming out soon.

The release is now feature complete and the first beta build is available. Let’s have a look at what it contains.

A lot of Binder improvements

Binder, which we introduced in Framework 8, is the tool that allows you to avoid boilerplate code when binding your domain objects to your UIs. It is also one of the features that is being moved to Flow with minimal changes. For 8.2 we have developed a couple of significant enhancements and updates related to the Binder:

  • It is now possible to refresh and remove existing bindings from a Binder
  • Binding builder methods don’t have to be chained anymore
  • Bean validation failures will revert changes in Binder
  • Parts of the API are opened for extension by application developers
  • Ability to specify binding and binder level validation status handlers

New Navigator implementation based on HTML5 History API

Vaadin Framework 8 introduced a new Java API to modify the URL displayed in the browser, using HTML5 History API. With it, single-page web apps can change the URL in your browser and add entries to the browser history, without actual page reloads. This way users can use back/forward buttons in their browser and refer to a specific part of the application, just by copying the address from their browser, even though they’d technically be staying on the same HTML page all the time.

Previously Vaadin and many other SPA frameworks used the anchor part of the URL to simulate real page changes, but the hack had certain downsides. The "hashbang hack" is also used by the Navigator class in Vaadin. Since 8.2 Vaadin there is now an option for Navigator users to start using proper URLs.

As we don’t want your URLs to suddenly change from the old “hashbang” style to standard URLs, we left the default to still use the old implementation. To take advantage of the new Navigator, you’ll need to enable it by adding @PushStateNavigation annotation to your UI class. With Vaadin Spring and Vaadin CDI, you still need to use the old implementation, but feature updates to those should follow shortly.

A collection of smaller features

There are also some smaller features to be published with 8.2. For example, there is a convenient helper called GridRowDragger which makes Grid automatically re-order the underlying java.util.List when users re-order rows in the UI. Another new feature to make the life of many developers simpler, is the ability to hook close listeners to Notifications. To see all enhancements, refer to the release notes of the latest pre-release.

Try it out now!

The 8.2 series is currently in a beta phase (Update: now already in release candidate), and we’d love to get some feedback on new features. We’d specifically like you to look into the renewals related to Binder. As usual, enable pre-releases repository in your current project or create a fresh 8.2 project using a Maven archetype and report issues in GitHub.

 
Matti Tahvonen
Matti Tahvonen
Matti Tahvonen has a long history in Vaadin R&D: developing the core framework from the dark ages of pure JS client side to the GWT era and creating number of official and unofficial Vaadin add-ons. His current responsibility is to keep you up to date with latest and greatest Vaadin related technologies. You can follow him on Twitter – @MattiTahvonen
Other posts by Matti Tahvonen