Refresh a treetable with HierarchialContainer data source

Hi everyone,

I have a treetable with hierarchial container as data source container set in editable mode. I want to refresh the table when the value of a property changes so that the other fields dependent on that property can be updated in UI. We have refresh() method for JPAContainer is there anyway to do that for hierarchial container.

Thank you.

If I’m not mistaken JPAContainer#refresh fetches data from database and refreshes your whole container. In that sense the the equivalent for HierarchicalContainer (and IndexedContainer) is just to update every item manually one by one or simply just build a new container datasource and set it as the datasource of the Table/Treetable. If you know that changed property is depended for example only by the children or parent, you can limit the amount of updates to avoid potentially costly full refresh of datasource. But anyways you have to handle the logic by yourself.

Hi Johannes,

My actual problem is I have a column generated with checkbox in the table. When the checkbox is checked all the other checkboxes in that column should be unchecked. I am changing the property value of that column in each row in the checkbox valuechangelistener but not committing to the database.Eventhough property value is changed the checkboxes still remain checked. sample code here

           CheckBox cb = new CheckBox();
            cb.addValueChangeListener(new ValueChangeListener() {
                public void valueChange(ValueChangeEvent event) {
                        for(Object itmId : source.getItemIds()){
                                source.getColumnGenerator(columnId).generateCell(source, itmId, columnId);
                }else {
            return cb;

Sorting the column by clicking on the header refreshes the values.So can i refresh the data only in the UI like sorting does.

Thank you.