Implementing a CRUD using Grids and forms
In this section, we'll develop a CRUD user interface using modal pop-up windows to show a form for adding and editing User
instances. The following is a screenshot of the finished form:

Let's start with the following component:
public class CustomCrud extends Composite { private Button refresh = new Button("", VaadinIcons.REFRESH); private Button add = new Button("", VaadinIcons.PLUS); private Button edit = new Button("", VaadinIcons.PENCIL); private Grid<User> grid = new Grid<>(User.class); public CustomCrud() { initLayout(); initBehavior(); refresh(); } private void initLayout() { CssLayout header = new CssLayout(refresh, add, edit); header.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP); grid.setSizeFull(); VerticalLayout layout = new VerticalLayout(header, grid); layout.setExpandRatio(grid, 1); setCompositionRoot(layout); setSizeFull(); } private void initBehavior() { } public void refresh() {...