Binding a list property to a table

I am new to vaadin and try to figure out how to bind objects to the ui.
Therefore I have created two simple classes:

  1. A Person class which represents my model:
public class Person implements Serializable {

    private static final long serialVersionUID = 1L;

    private String name;
    private List<String> pets;

    public Person(String name) { = name;

    public String getName() {
        return name;

    public void setName(String name) { = name;

    public List<String> getPets() {
        return pets;

    public void setPets(List<String> pets) {
        this.pets = pets;

    public static List<Person> getPersons() {
        Person person1 = new Person("Bernhard");
        person1.setPets(createListOfhaustiere("dog", "cat"));
        Person person2 = new Person("Sebastian");
        person1.setPets(createListOfhaustiere("mouse", "fish"));

        List<Person> personList = Arrays.asList(person1, person2);

        return personList;

    private static List<String> createListOfhaustiere(String... ids) {
        List<String> liste = new ArrayList<String>();
        for (int i = 0; i < ids.length; i++) {
        return liste;
  1. A simple UI class to show model changes
public class MyVaadinUI extends UI implements Serializable {

    private static final long serialVersionUID = 1L;

    private int currentPerson = 0;

    @WebServlet(value = { "/*", "/VAADIN/*" }, asyncSupported = true)
    @VaadinServletConfiguration(productionMode = false, ui = MyVaadinUI.class, widgetset = "com.bentele.AppWidgetSet")
    public static class Servlet extends VaadinServlet {

        private static final long serialVersionUID = 1L;


    protected void init(VaadinRequest request) {
        Person person = Person.getPersons().get(0);
        VerticalLayout layout = new VerticalLayout();

        // Create name field
        TextField nameTextField = new TextField("Name");

        // create table for pets
        Table petsTable = new Table("Haustiere");
        petsTable.addContainerProperty("Pet", String.class, null);

        final BeanFieldGroup<Person> binding = new BeanFieldGroup<Person>(Person.class);

        binding.bind(nameTextField, "name");
        binding.bind(petsTable, "pets");

        Button changeButton = new Button("change");
        changeButton.addClickListener(new Button.ClickListener() {

            public void buttonClick(ClickEvent event) {
                currentPerson = currentPerson == 0 ? 1 : 0;
                Person newPerson = Person.getPersons().get(currentPerson);




As you can see I use the BeanFieldGroup to change the underlying model,
This works fine for simple string properties but at some point I have to represent 1:n relationships!

In this case it is just a list of strings but I could also imagine a list of complex objects at this point.

Unfortuanetly the table does not show entries from the list. What am I doing wrong ??