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)

Implementing a CRUD using an editable Grid component

In this section, we'll implement a component containing an editable Grid. The following is a screenshot of the application showing the Grid component in edit mode:

For simplicity, in this example, we'll omit the add and the delete CRUD operations for now. Let's start by creating a class to encapsulate the component as follows:

public class EditableGridCrud extends Composite {

private Grid<User> grid = new Grid<>();

public EditableGridCrud() {
initLayout();
initBehavior();
}

private void initLayout() {
grid.setSizeFull();
VerticalLayout layout = new VerticalLayout(grid);

setCompositionRoot(layout);
setSizeFull();
}

private void initBehavior() {
}
}

The class, which extends Composite, declares a Grid to show User instances. There are several...