Note that there are some explanatory texts on larger screens.

plurals
  1. POSet html field from GWT?
    text
    copied!<p>I have a GWT application that need to set html field from java code(GWT) i tried this but element is always null</p> <pre><code> Element element = Document.get().getElementById("elementID"); if (element != null) { GWT.log("found element with id:" + "elementID"); // some code.... } </code></pre> <p>Project structure:</p> <p>|---Main.html: page that loads compiled module</p> <p>|---page.html: the page that need to be updated from GWT</p> <p>So my question, is it possible to set field in page.html from GWT code, if so how??</p> <blockquote> <p><strong>Note:</strong> page.html is show after clicking anchor defined like this:Anchor anchor = new Anchor( "message", false, "page.html", "_blank");</p> </blockquote> <p><strong>EDIT:</strong> Page.html:</p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body style="font-size:62.5%;"&gt; &lt;div align="center" width="100%" height="80%"&gt; &lt;table height="80%" width="40%"&gt; &lt;tr valign="bottom"&gt; &lt;td align="center"&gt; &lt;div id="progressbar"&gt;&lt;/div&gt; &lt;/td&gt; &lt;td&gt;&lt;a id="cancel" href="#"&gt;&lt;img src="close_icon_x.png" height="32px" width="32px"/&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;div id ="elementID"&gt;&lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Main.html:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt; &lt;script type="text/javascript" language="javascript" src="project/MyProject.nocache.js"&gt;&lt;/script&gt; &lt;link media="all" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" rel="stylesheet"&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;link type="text/css" rel="stylesheet" href="Style.css"&gt; &lt;/head&gt; --&gt; &lt;body&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;/body&gt; &lt;/html&gt; </code></pre>
 

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