BeanItemContainer table access a property

Hi!
I have a table who is fill with a BeanItemContainer. My BeanItemContainer contains an object which contains other object and I would like to access a property on the second object to show it in a column of my table.
I explain more :
I have an object “Intervention” which has an id and a “Localisation” which have a Name, and a Town.
In my table I want :
intervention id | localisation name | localisation town

For choose my column I do :

InterventionContainer.NATURAL_COL_ORDER = {"id",...};
InterventionContainer.COL_HEADERS = {"intervention id",...};
 this.setVisibleColumns(InterventionContainer.NATURAL_COL_ORDER);
 this.setColumnHeaders(InterventionContainer.COL_HEADERS);

But I do : InterventionContainer.NATURAL_COL_ORDER = {"id","localisation.name"};
it doesn’t work.

How can I do??

Julie

I’m not sure if you can go deeper into your objects and get fields from objects the main object refers to.

I think you can, however, use table’s addGeneratedColumns to add about what ever to your table. All you need is to get a hold of your Intervention -object, which is usually put into the row id.

It should work about like this:

table.addGeneratedColumn("name", new Table.ColumnGenerator() {
    
    public Component generateCell(Table source, Object itemId, Object columnId) {
        return Label(((itemId)Loalisation).getName());
    }
});
table.addGeneratedColumn("town", new Table.ColumnGenerator() {
    
    public Component generateCell(Table source, Object itemId, Object columnId) {
        return Label(((itemId)Loalisation).getTown());
    }
});