Reviewers: Ray Ryan, jgw, Description: Description: ============ If Widget#onLoad/onUnload throws an exception, it will propagate up and prevent proper attachment/detatchment of widgets in a variety of cases. This inconsistent state is unresolvable in GWT and leaves widgets permanently physically attached to the page.
The best example is Panel#doAttach/DetachChildren, which currently only attaches/detaches until an error is reached. Other examples include widgets with a single child, and Tree, which detaches children just like Panel. Fix: === In Panel#doAttach/DetachChildren, we now combine multiple exceptions into one, allowing each child to finish attaching/detaching. In addition, we use a bunch of try/finally blocks to ensure that a widgets physical state always matches its logical state, even if onLoad/Unload throws an exception. Testing: ======= I wrote a unit test to verify this case. I also ran through UISuite. Please review this at http://gwt-code-reviews.appspot.com/66805 Affected files: user/src/com/google/gwt/user/client/ui/ComplexPanel.java user/src/com/google/gwt/user/client/ui/DialogBox.java user/src/com/google/gwt/user/client/ui/HTMLTable.java user/src/com/google/gwt/user/client/ui/Panel.java user/src/com/google/gwt/user/client/ui/RootPanel.java user/src/com/google/gwt/user/client/ui/SimplePanel.java user/src/com/google/gwt/user/client/ui/SplitPanel.java user/src/com/google/gwt/user/client/ui/Tree.java user/src/com/google/gwt/user/client/ui/Widget.java user/test/com/google/gwt/user/client/ui/PanelTest.java user/test/com/google/gwt/user/client/ui/WidgetTest.java --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
