How can I display a property in a MTable of an instance i2 (of class O2) th

Dear all,

I use viritin mtable to display lists of JPA entities. I do not use the JPA container but instead EJBs to offer services for database operations.

Now, I want to display in the table the list of objects, say of class O1 (with property p1, along with the relations instances of O1 have with objects of another class, say O2 (with property p2). O1 has precisely one O2.

Things I have tried sofar:

  • loading property p2 in the table via table.setVisibleColumns(…, “relation.p2”)
    "relation is the name the JPA instance of class O1 has with the instance of class O2.
    This does not work

  • Using a generated column that retrieves property p2 of the instance of O2. This result in
    ava.lang.UnsupportedOperationException: Not supported yet.
    at org.vaadin.viritin.ListContainer.addContainerProperty(ListContainer.java:337)
    at com.vaadin.ui.AbstractSelect.addContainerProperty(AbstractSelect.java:815)
    at com.vaadin.ui.Table.addContainerProperty(Table.java:4334)
    at com.vaadin.ui.Table.addContainerProperty(Table.java:4371)

In sum: how can I display a property in a MTable of an instance i2 (of class O2) that is referred to by instance i1 (of class O1).

Hi,

I think
this example code
is what you are looking for. Let me know if it don’t help you to figure out the the problem. The nested property handling should really be added to the
Viritin documentation
site.

cheers,
matti