How to add column to browse which correspond entity field

I’d like add column to browse which correspond to entity field. I need to do it in java code,
I try to use code like below, but it isn’t work rightly.

MetaClass metaClass = articlesesDs.getMetaClass();
				Table.Column column = new Table.Column(metaClass.getPropertyPath("<column name from entity>"));
				articlesesTable.addColumn(column);

Hello @andrzej.paluch72

You have to refresh the table after adding the column:

// deprecated
articlesesTable.refresh();
// or
articlesesDs.refresh();

Regards,
Daniil

Thanks

I use your tip and refresh datasource. Now I have problem because, column caption is in english version. I use in my application other language and
when I add this same column in cuba studio column caption is rightly.
I see then method addColumn not translate column caption .

You can use second constructor with column caption and pass localized caption as the second argument:

@Inject
private Messages messages;

private void bar() {
    MetaPropertyPath mpp = articlesesDs.getMetaClass().getPropertyPath("<column name from entity>");
    String colCaption = messages.getMessage(...);
    Table.Column column = new Table.Column(mpp, colCaption);

    articlesesTable.addColumn(column);
    articlesesTable.refresh();
}