| Issue 1121: | Regression: -- add(widget) in onLoad() throws IllegalStateException | |
| 4 people starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
Found in GWT Release:
1.4.10RC
Detailed description:
The following code works in 1.3.3, but throws an exception in 1.4.10 RC.
public class Test implements EntryPoint {
class TestPanel extends SimplePanel {
protected void onLoad() {
super.onLoad();
add(new Label("label"));
}
}
public void onModuleLoad() {
RootPanel.get().add(new TestPanel()); //exception
}
}
The stack trace is:
[ERROR] Unable to load module entry point class
com.allen_sauer.gwt.test.client.Test (see associated exception for details)
java.lang.IllegalStateException: Should only call onAttach when the
widget is detached from the browser's document
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:89)
at com.google.gwt.user.client.ui.Panel.onAttach (Panel.java:86)
at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:216)
at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:59)
at
com.google.gwt.user.client.ui.ComplexPanel.insert(ComplexPanel.java:107)
at com.google.gwt.user.client.ui.ComplexPanel.add
(ComplexPanel.java:70)
at
com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:68)
at com.allen_sauer.gwt.test.client.Test.onModuleLoad(Test.java:22)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
Workaround if you have one:
Links to the relevant GWT Developer Forum posts:
http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/c51e7201ece461f3
|
||||||||||||||
,
May 30, 2007
This is another example of the inherit flaw in the onLoad() method. See comment 5 of issue 896 for another example: http://code.google.com/p/google-web-toolkit/issues/detail?id=896#c5 More discussion of this at: http://groups.google.com/group/Google-Web-Toolkit-Contributors/msg/5e89e9081a034598 |
|||||||||||||||
,
Jun 06, 2007
There may not be much we can do for this before 1.4, but we can at least think about it. :)
Labels: -Priority-Medium Priority-High Category-UI Milestone-1_4_RC2
|
|||||||||||||||
,
Jun 06, 2007
(No comment was entered for this change.)
Owner: gwt.team.jgw
|
|||||||||||||||
,
Jun 12, 2007
(No comment was entered for this change.)
Status: Accepted
|
|||||||||||||||
,
Jun 27, 2007
(No comment was entered for this change.)
Status: Started
|
|||||||||||||||
,
Jul 10, 2007
Committed fix as r1229. |
|||||||||||||||
,
Jul 10, 2007
(No comment was entered for this change.)
Status: FixedNotReleased
|
|||||||||||||||
,
Aug 03, 2007
Committed a general overhaul as r1288. See this discussion thread: http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/1e90fa326df6dad/ |
|||||||||||||||
,
Aug 20, 2007
1.4 RC2 now released.
Status: Fixed
|
|||||||||||||||
|
,
Apr 28, 2008
Owner: jgw
|
|||||||||||||||
|
|
|||||||||||||||