Skip to content

Commit

Permalink
Extra 6 | Organize and remove unneeded grid columns
Browse files Browse the repository at this point in the history
  • Loading branch information
amahdy committed Jun 1, 2017
1 parent 27a5318 commit 5aa3539
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/vaadin/stepbystep/MyUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MyUI extends UI {
PersonService service;

HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
Grid<Person> grid = new Grid<>(Person.class);
Grid<Person> grid = new Grid<>();
PersonEditorView editorView = new PersonEditorView(person -> {

Person save = service.save(person);
Expand All @@ -41,6 +41,10 @@ protected void init(VaadinRequest vaadinRequest) {
listPersons();
selectDefault();

grid.addColumn(Person::getFirstName).setCaption("First Name");
grid.addColumn(Person::getLastName).setCaption("Last Name");
grid.addColumn(Person::getEmail).setCaption("E-Mail");

grid.asSingleSelect().addValueChangeListener(evt -> {
Person value = evt.getValue();
if(value==null) {
Expand Down

0 comments on commit 5aa3539

Please sign in to comment.