Table did not refresh on IndexedContainer changes

hi,

we try to build a TwinTable on our own because we want it a bit more flexible for us than TwinColSelect.

So we have a TwinTable class with 2 Tables which gets the Container from Constructor Parameter.
And some Buttons to move Objects from right to left and other way.

And if we move object/Items from one container to the other, this works fine for BeanItemContainer, but with IndexedContainer the table did not refresh.
a small cell is generated, but without the values… I attach a photo to show what i mean.

Here is the move Statement:


protected void moveSelected(Table from, Table to) {
        Collection<?> selection = (Collection<?>) from.getValue();
        for (Object object : selection) {
            to.getContainerDataSource().addItem(object);
            from.getContainerDataSource().removeItem(object);
        }
    }

13166.png

sorry… mean this screenshot
13167.png

In a BeanItemContainer, the ID (which you add to the other container) is also the content.

In an IndexedContainer, the ID and the content are completely separate and the content is not just a POJO but effectively the list of all properties and their values that are stored separately in the container. Thus, you might need to copy them, too.