|
|
|
@ -12,6 +12,7 @@ import com.vaadin.ui.VerticalLayout; |
|
|
|
|
|
|
|
|
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.PersonDao; |
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.PersonDao; |
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
|
|
|
|
|
|
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components.PersonGrid; |
|
|
|
|
|
|
|
|
|
|
|
@SpringUI |
|
|
|
@SpringUI |
|
|
|
public class MainUi extends UI { |
|
|
|
public class MainUi extends UI { |
|
|
|
@ -24,11 +25,13 @@ public class MainUi extends UI { |
|
|
|
protected void init(VaadinRequest request) { |
|
|
|
protected void init(VaadinRequest request) { |
|
|
|
VerticalLayout layout = new VerticalLayout(); |
|
|
|
VerticalLayout layout = new VerticalLayout(); |
|
|
|
layout.addComponent(new Label("Persons found:")); |
|
|
|
layout.addComponent(new Label("Persons found:")); |
|
|
|
|
|
|
|
|
|
|
|
List<Person> persons = dao.list(); |
|
|
|
List<Person> persons = dao.list(); |
|
|
|
for (Person p : persons) { |
|
|
|
PersonGrid grid = new PersonGrid(); |
|
|
|
layout.addComponent( |
|
|
|
grid.setItems(persons); |
|
|
|
new Label(p.getPrename() + " " + p.getSurname())); |
|
|
|
grid.setCaption("Person Grid"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
layout.addComponent(grid); |
|
|
|
setContent(layout); |
|
|
|
setContent(layout); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|