Skip to content

Instantly share code, notes, and snippets.

@alejandro-du
Created February 13, 2018 20:25
Show Gist options
  • Save alejandro-du/1c4b035fdb01fbb8ad24f286086a53a8 to your computer and use it in GitHub Desktop.
Save alejandro-du/1c4b035fdb01fbb8ad24f286086a53a8 to your computer and use it in GitHub Desktop.
Grid example
package com.vaadin.starter.skeleton;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.theme.Theme;
import com.vaadin.flow.theme.lumo.Lumo;
@Route("")
@Theme(Lumo.class)
public class MainView extends VerticalLayout {
private PersonService service = PersonService.getInstance();
public MainView() {
Grid<Person> grid = new Grid<>(Person.class);
grid.setSizeFull();
add(grid);
grid.setItems(service.findAll());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment