Binding data in a table

I’ve found this bug (??):

if the source code is
table.setContainerDataSource(container);
table.setVisibleColumns(colonne);
table.setColumnHeaders(headers);

all is ok
but if I configure before the table (normal and NATURAL thing):

	table.setVisibleColumns(colonne);
	table.setColumnHeaders(headers);
            table.setContainerDataSource(container);

I receive this error:

Caused by: java.lang.IllegalArgumentException: Ids must exist in the Container or as a generated column , missing id: id

It isn’t maybe a bug, but I’ve lost many hours to find it!

No, it isn’t a bug; the Table has by default an empty IndexedContainer as a data source. Naturally, that container doesn’t have your specified properties in it, and therefore doesn’t accept your parameters.

I’m adding rows to table by using table.addItem();

Then after table.setVisibleColumns(visibleColumns.toArray()) I have the same exception.

Is this also the feature?