Book Image

Data-Centric Applications with Vaadin 8

By : Alejandro Duarte
Book Image

Data-Centric Applications with Vaadin 8

By: Alejandro Duarte

Overview of this book

Vaadin is an open-source Java framework used to build modern user interfaces. Vaadin 8 simplifies application development and improves user experience. The book begins with an overview of the architecture of Vaadin applications and the way you can organize your code in modules.Then it moves to the more advanced topics about advanced topics such as internationalization, authentication, authorization, and database connectivity. The book also teaches you how to implement CRUD views, how to generate printable reports, and how to manage data with lazy loading. By the end of this book you will be able to architect, implement, and deploy stunning Vaadin applications, and have the knowledge to master web development with Vaadin.
Table of Contents (11 chapters)

Ordering rows in Grid components

As you can guess, ordering (or sorting) is another task that should be delegated to the backend services when possible. Moreover, it is most likely required when you are implementing pagination (that is, lazy loading using limit and offset parameters) in the backend service as well.

The service method should include a parameter that specifies how to perform the ordering. The Grid component allows users to click on the column headers to activate ordering by that column. These columns that need ordering are passed to the DataProvider in a Query object. You can get these by calling the Query.getSortOrders() method, which returns a List of QuerySortOrder objects. You could pass this List to the service method, but it's always a good idea to avoid coupling the backend services with frontend technologies. QuerySortOrder is a class included in Vaadin...