title: GWT RootLayoutPanel: This widget's parent does not implement HasWidgets
body: <p>I'm working with GWT 2.4 and MVP pattern, so I have Presenters and Views (without UIBinder). I have problems with one of them. I have a View with a TabLayoutPanel and more widgets inside. If I use a LayoutPanel all works fine, but if I use RootLayoutPanel I have errors.</p>
  
  <pre><code>public class JaviView extends Composite implements FacturasPresenter.Display {
  
      private  RootLayoutPanel rootLayoutPanel = RootLayoutPanel.get();
      private TabLayoutPanel tabPanel;
      //...more declarations
  }
  
   public JaviView(){
              initWidget(rootLayoutPanel);
              rootLayoutPanel.setSize("100%", "100%");
              //...
              tabPanel = new TabLayoutPanel(1.7, Unit.EM);
              //add widgets to tabPanel
              tabPanel.setWidth("100%");
              rootLayoutPanel.add(tabPanel);
  }
  </code></pre>
  
  <p>I'm getting: This widget's parent does not implement HasWidgets. </p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: This widget's parent does not implement HasWidgets
      at com.google.gwt.user.client.ui.Widget.removeFromParent(Widget.java:204)
      at com.google.gwt.user.client.ui.Composite.initWidget(Composite.java:145)
      at contabilidad.presentation.client.view.facturas.JaviView.&lt;init&gt;(JaviView.java:318)
  </code></pre>
  
  <p>The line 318 is: initWidget(rootLayoutPanel). If I use a LayoutPanel I dont have that error, but I need to use a RootLayoutPanel.</p>
  
  <p>I have copied the code and pasted into another View, with RootLayoutPanel and works fine, so I don't know where is the problem. I have been looking for the solution for hours. Thanks in advance.</p>
  
  <p>Full trace here:</p>
  
  <pre><code>10:16:49.595 [ERROR] [contabilidadweb] Uncaught exception escaped
  
  com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
      at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
      at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
      at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
      at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
      at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:698)
      at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
      at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
      at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
      at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
      at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
      at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
      at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
      at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
      at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
      at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
      at com.google.gwt.dom.client.DOMImplStandard.dispatchEvent(DOMImplStandard.java)
      at com.google.gwt.dom.client.Element$.dispatchEvent$(Element.java:142)
      at com.google.gwt.user.client.ui.CustomButton.onClick(CustomButton.java:825)
      at com.google.gwt.user.client.ui.PushButton.onClick(PushButton.java:190)
      at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:656)
      at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
      at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
      at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
      at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
      at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
      at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
      at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
      at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
      at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
      at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
      at java.lang.Thread.run(Thread.java:680)
  Caused by: com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
      at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
      at contabilidad.presentation.client.presenter.contabilidad.PrincipalPresenter$3.onClick(PrincipalPresenter.java:149)
      at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
      at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
      at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
      at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
      at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
      at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
      at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
      at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
      at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
      at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
      at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:698)
      at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
      at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
      at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
      at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
      at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
      at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
      at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
      at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
      at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
      at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
      at com.google.gwt.dom.client.DOMImplStandard.dispatchEvent(DOMImplStandard.java)
      at com.google.gwt.dom.client.Element$.dispatchEvent$(Element.java:142)
      at com.google.gwt.user.client.ui.CustomButton.onClick(CustomButton.java:825)
      at com.google.gwt.user.client.ui.PushButton.onClick(PushButton.java:190)
      at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:656)
      at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
      at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
      at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
      at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
      at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
      at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
      at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
      at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
      at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
      at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
      at java.lang.Thread.run(Thread.java:680)
  Caused by: java.lang.IllegalStateException: This widget's parent does not implement HasWidgets
      at com.google.gwt.user.client.ui.Widget.removeFromParent(Widget.java:204)
      at com.google.gwt.user.client.ui.Composite.initWidget(Composite.java:145)
      at contabilidad.presentation.client.view.facturas.JaviView.&amp;lt;init&amp;gt;(JaviView.java:318)
      at contabilidad.presentation.client.AppController.doFacturas(AppController.java:164)
      at contabilidad.presentation.client.AppController.access$0(AppController.java:162)
      at contabilidad.presentation.client.AppController$1.onFacturas(AppController.java:69)
      at contabilidad.presentation.client.event.facturas.FacturasEvent.dispatch(FacturasEvent.java:29)
      at contabilidad.presentation.client.event.facturas.FacturasEvent.dispatch(FacturasEvent.java:1)
      at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
      at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
      at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
      at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
      at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
      at contabilidad.presentation.client.presenter.contabilidad.PrincipalPresenter$3.onClick(PrincipalPresenter.java:149)
      at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
      at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
      at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
      at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
      at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
      at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
      at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
      at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
      at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
      at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
      at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:698)
      at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
      at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
      at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
      at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
      at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
      at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
      at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
      at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
      at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
      at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
      at com.google.gwt.dom.client.DOMImplStandard.dispatchEvent(DOMImplStandard.java)
      at com.google.gwt.dom.client.Element$.dispatchEvent$(Element.java:142)
      at com.google.gwt.user.client.ui.CustomButton.onClick(CustomButton.java:825)
      at com.google.gwt.user.client.ui.PushButton.onClick(PushButton.java:190)
      at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:656)
      at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
      at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
      at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
      at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
      at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
      at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
      at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
      at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
      at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
      at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
      at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
      at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
      at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
      at java.lang.Thread.run(Thread.java:680)
  </code></pre>