Caused by: java.lang.AssertionError: Child cannot be null
at com.google.gwt.dom.client.Node$.isOrHasChild$(Node.java:278)
at com.google.gwt.user.client.ui.Button.wrap(Button.java:55)
HTML Code:
<div style="display:none">
<form id="login_form" action="javascript:;">
<input id="username" type="text">
<input id="password" type="password">
<button type="button" id="submit" name="submit" value="Submit">
</form>
</div>
Java Code (GWT):
loginButton = Button.wrap(Document.get().getElementById("submit"));
Is there any way to wrap a submit button?
I am getting an error when I try to wrap a submit button with GWT:Caused by: java.lang.AssertionError: Child cannot be null
at com.google.gwt.dom.client.Node$.isOrHasChild$(Node.java:278)
at com.google.gwt.user.client.ui.Button.wrap(Button.java:55)
Yes I debug it. And yes, I see that
Document.get().getElementById("submit") returns null. However, it should
not be null since there is a <button> in the HTML file that has that id.