Grid Nested List Of Properties

Hello together, how can show a list of properties which is inside of a bean.
For Example here are my two (simplified) beans:

@Entity
public class Customer {
  @Id
  private Long idCustomer;
...
  @OneToMany(mappedBy = "customer", cascade = { CascadeType.PERSIST, CascadeType.MERGE })
  private List<CustomerAddress> customerAddresses;
...
}

@Entity
public class CustomerAddress {
  @Id
  private Long idCustomerAddress;
...
  @ManyToOne
  @JoinColumn(name = "ID_CUSTOMER")
  private Customer customer;
...
}

I started with a BeanItemContainer wrapped with a GeneratedPropertyContainer. I created some more columns with the desired properties. But i think a GeneratedPropertyContainer is very difficult to handle. it doesn’t take the Type of the BeanItemContainer very well. I have to cast all the time. There are also some missing methods like “addAll” and some missing filter methods. But the biggest problem ist, that the properties are read only. Why is that designed like that? Why not additionaly if you create a PropertyValueGenerator, there is also a “setValue” method? The bad thing is so i have to remove and add the column for update. But thats very bad and it flickers.

So i also tried this with a BeanItemContainer and "addNestedContainerBean(“customerAddresses”). There is no error but there are also no columns for that. I think this is okay, because the container doesn’t know which address to show. But isn’t there a propertyformatter or something like that, which i can say that i want to show the first item of the list.

So how can i do that or should i select my components that it fits my bean classes?
Create two grids and if i select my customer i have a second grid which shows the addresses?

I tried adding a nested bean using addNestedContainerBean(“myBean”) and the nested beans’ properties were shown as grid columns. If you want to show just specific fields of the nested bean, you add them by calling addNestedContainerProperty(“customerAddress.zipCode”).

As for “property formatter”, if you want to use that approach, create a class that implements the Converter interface and converts your Address bean into a string, then apply that converter to the grid column.

The addNestedContainerBean(“myBean”) Method wont work, because its a list. and the addNestedContainerProperty(“customerAddress.zipCode”) won’t work too.

Okay, maybe i can do it with a list to string converter. I will try it and give feedback soon.

Okay, it doesn’t work so because i want multiple columns for that, and so i have to use the GeneratedPropertyContainer. That is definitly not what i want.