Im trying to re-expand objects in a TreeTable after I have reset the container datasource for the TreeTable but i doesnt work. Has anyone tried this before? Where am I going wrong?
private void setTableDataSource() {
Set<Object> expandedMap = new HashSet<Object>();
if(table.getItemIds() != null && !table.getItemIds().isEmpty()){
for(Object o : table.getItemIds()){
if(table.isCollapsed(o))
expandedMap.add(o);
}
}
table.setContainerDataSource(ContactContainerFactory.createContainer(model.getParentModel()));
table.setVisibleColumns(new String[]{"title", "operation", "id", "price"});
table.setColumnHeaders(getTranslatedTableHeaders());
if(!expandedMap.isEmpty()){
for(Object o : expandedMap){
table.setCollapsed(o, false);
}
}
}