I have a tree table which I am trying to update from a multi-threaded application.
I have tried various methods of updating an embedded image in row of a treetable. The results are completely inconsistent. Sometimes the table is updated and repaint is called and sometimes not. am I doing something wrong?
public synchronized void setState(int state) {
// Look at the value before the change
System.out.println("before:" + reportFileBean.getStateIcon().getSource().toString());
Item tempItem = reconciliationsTable.getItem(reportFileBean);
tempItem.getItemPropertyIds();
Property prop = tempItem.getItemProperty(SmartConstant.REC_TABLE_STATE);
Embedded image = (Embedded) prop.getValue();
image.setSource(new ThemeResource(TRAFFICLIGHTSSTRING[state]
));
// look at the value after the change
System.out.println("after:" + reportFileBean.getStateIcon().getSource().toString());
reconciliationsTable.requestRepaint();
reconciliationsTable.requestRepaintAll();
reconciliationsTable.requestRepaintRequests();
reconciliationsTable.refreshRowCache();
reconciliationsTable.commit();
PropertySetChangeEvent event = new PropertySetChangeEvent() {
public Container getContainer() {
return reconciliationsTable.getContainerDataSource();
}
};
reconciliationsTable.containerPropertySetChange(event);
}
The value is always shown as changed in the system.out lines but not in my browser(chrome)
Thanks in advance for any help.