Hi all
I have added some child widgets in a vertical panel before vertical
panel got attach. Now a child widget has thrown some exception in its
onAttach method. Now want to clear this panel, but no way I am getting
'java.lang.IllegalStateException: Should only call onDetach when the
widget is attached to the browser's document'
Sample code to produce the bug:
VerticalPanel v = new VerticalPanel();
Button b = new Button() {
protected void onAttach() {
if (true) {
throw new ResourceException("Exception in
onAttach");
}
super.onAttach();
}
};
v.add(b);
try {
RootPanel.get().add(v);
} catch (Exception e) {
} finally {
try{
v.clear();
}catch(Exception e){
}finally{
Window.alert("Finally" + v.getWidgetCount());
}
}
Thanks and Regards
Rick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---