dynamic creation in this way is a bit tricky. Actually, you could do two things:
1. bind your table to a variable (UIDataTable) and create the columns via Java-Code
2. OR: flush the columns from the viewroot as the data get's updated (via ViewRoot/findComponent)
I tried your second suggestion, because I want to keep the table defined outside Java.
Now I find my table via viewRoot.findComponent(...), iterate over its columns and call a viewRoot.removeComponentResource(context, component) for each column. Is this the flushing you meant? Because, sadly, it does not work so far, still get weird columns.
Ok, I found how to solve this.
First I do a viewRoot.findComponent(...) and then table.getParent().getChildren().remove(table);
So, after my update-calculations the whole new table gets rendered with correct header breaks.