petko.ivanov
23 Dec 2010, 8:02 AM
hi,
have the following weird problem.
I have a chart controlled with a CheckBoxGroup. When a data update comes, the CheckBoxGroup need to be updated. So i am constructing a new group, and replacing the old one. Here is the code that does the replacing :
@SuppressWarnings("unchecked")
public static boolean replaceDisplayed(Widget remove, Widget insert){
LayoutContainer c = (LayoutContainer) remove.getParent();
List items = c.getItems();
for(int i=0;i<items.size();i++){
if (items.get(i)==remove){
c.insert(insert, i);
c.remove(remove);
c.layout(true);
return true;
}
}
return false;
}
It works as intended in debug mode ie with the gwt browser plugin from debugger, but when i deploy it, it fails. The checkboxes in the group do not affect the chart. If i switch to a different tab and back to this one, everything works. Any theories? It has to be some kind of refresh that gets triggered with the tab switching to fix it, i tried .repaint() and .recalculate() but did not seem to help.
thanks
have the following weird problem.
I have a chart controlled with a CheckBoxGroup. When a data update comes, the CheckBoxGroup need to be updated. So i am constructing a new group, and replacing the old one. Here is the code that does the replacing :
@SuppressWarnings("unchecked")
public static boolean replaceDisplayed(Widget remove, Widget insert){
LayoutContainer c = (LayoutContainer) remove.getParent();
List items = c.getItems();
for(int i=0;i<items.size();i++){
if (items.get(i)==remove){
c.insert(insert, i);
c.remove(remove);
c.layout(true);
return true;
}
}
return false;
}
It works as intended in debug mode ie with the gwt browser plugin from debugger, but when i deploy it, it fails. The checkboxes in the group do not affect the chart. If i switch to a different tab and back to this one, everything works. Any theories? It has to be some kind of refresh that gets triggered with the tab switching to fix it, i tried .repaint() and .recalculate() but did not seem to help.
thanks