gwt - Writing to a new window -
im trying simple javascript working in gwt keep failing.
the code:
public static native void createwindow() /*-{ var wndref = $wnd.open('','edit'); var divtag = document.createelement("div"); divtag.id = "div1"; divtag.setattribute("align","center"); divtag.style.margin = "0px auto"; divtag.innerhtml = "blah blah blah"; wndref.document.body.appendchild(divtag); }-*/;
i trying open new window , write content it
the problem: code opens new window empty.
how write content ? doing wrong or expecting gwt?
context: end goal open new window , have form panel , various widgets inserted in via java methods.
gwt compiled javascript, gwt can js can do.
if want open new window , inject content right way:
var win = window.open("", "win", "width=300,height=200"); // window object win.document.open("text/html", "replace"); win.document.write("<html><head><title>new document</title></head><body>hello, world!</body></html>"); win.document.close();
Comments
Post a Comment