Gaurav Sharma
Gaurav Sharma

Reputation: 4052

Vaadin: table container has object members

I'm extending the BeanItemContainer and using it as a container for a table in Vaadin.

public class MyContainer extends BeanItemContainer<MyClass>
        implements Serializable {
...
}

The MyClass object has a structure as shown below:

public class MyClass {
    private int id;
    private InnerClass data;
...
}

And the InnerClass has the structure:

public class InnerClass {
    private int propA;
    private String propB;
...
}

I'd like to display the id and data.propA columns but I'm not sure how to in Vaadin.

Upvotes: 1

Views: 2414

Answers (1)

Gaurav Sharma
Gaurav Sharma

Reputation: 4052

The solution is to use the addNestedContainerProperty property.

Refer to https://vaadin.com/book/-/page/datamodel.container.html for details.

Upvotes: 1

Related Questions