Note that there are some explanatory texts on larger screens.

plurals
  1. POGWT 2.2 RootPanel CSS error
    primarykey
    data
    text
    <p>Hey guys, I'm just starting out with GWT and am getting the following error when I run the project in Eclipse</p> <blockquote> <p>19:36:16.084 [ERROR] [adaptivgwt] Warning: com.google.gwt.user.client.ui.RootPanel descendants will be incorrectly positioned, i.e. not relative to their parent element, when 'position:static', which is the CSS default, is in effect. One possible fix is to call 'panel.getElement().getStyle().setPosition(Position.RELATIVE)'.</p> <p>java.lang.IllegalStateException: com.google.gwt.user.client.ui.RootPanel is missing CSS 'position:{relative,absolute,fixed}' at com.google.gwt.user.client.ui.AbsolutePanel.verifyPositionNotStatic(AbsolutePanel.java:279) at com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:118) at com.ivstel.adaptiv.client.AdaptivGWT.loadLogin(AdaptivGWT.java:29) at com.ivstel.adaptiv.client.AdaptivGWT.onModuleLoad(AdaptivGWT.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Unknown Source)</p> </blockquote> <p>This is what my <a href="http://paste2.org/p/1273521" rel="nofollow">entry point</a> looks like:</p> <pre><code>public class AdaptivGWT implements EntryPoint { private static AdaptivGWT singleton; public static AdaptivGWT get() { return singleton; } public void onModuleLoad() { singleton = this; loadLogin(); } public void loadLogin() { RootPanel.get("login").clear(); RootPanel.get("main").clear(); LoginGWT login = new LoginGWT(); RootPanel.get("login").add(login, 10, 10); } public void loadMain(User user) { RootPanel.get("login").clear(); MainGWT main = new MainGWT(); RootPanel.get("main").add(main, 10, 10); } } </code></pre> <p>The HTML file.</p> <pre><code>&lt;!doctype html&gt; &lt;!-- The DOCTYPE declaration above will set the --&gt; &lt;!-- browser's rendering engine into --&gt; &lt;!-- "Standards Mode". Replacing this declaration --&gt; &lt;!-- with a "Quirks Mode" doctype may lead to some --&gt; &lt;!-- differences in layout. --&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt; &lt;link type="text/css" rel="stylesheet" href="AdaptivGWT.css"&gt; &lt;title&gt;Adaptiv&lt;/title&gt; &lt;script type="text/javascript" language="javascript" src="adaptivgwt/adaptivgwt.nocache.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;!-- OPTIONAL: include this if you want history support --&gt; &lt;iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"&gt;&lt;/iframe&gt; &lt;!-- RECOMMENDED if your web app will not function without JavaScript enabled --&gt; &lt;noscript&gt; &lt;div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"&gt; Your web browser must have JavaScript enabled in order for this application to display correctly. &lt;/div&gt; &lt;/noscript&gt; &lt;div id="login"&gt;&lt;/div&gt; &lt;div id="main"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload