Open a native popup window and fill it with gwt doesn't work

57 views
Skip to first unread message

wet...@gmail.com

unread,
Sep 21, 2011, 12:15:34 AM9/21/11
to google-we...@googlegroups.com
Hi all,

I my app, i want to alert the user for an important information, even he is working on a other things (i.e word or other app). To alert him only native popup (windows popup ws popup panel) can be put at the front of his desk.


So here is my code to do that, it's running without error but nothing is display on the popup. With the java gwt debugger we have the dom corresponding html content to the code:
"<div><div class="gwt-label"...>Text for popup window</div></div>
With firebug we can see the dom structure but it's in shadowing code writed.

I know that it's a huggly way to use gwt but for me it's should be work.


private static void displayWarningDialogBox() {

        openInNewWindow(new Label("Text for popup window"));
   
   
    }

    private static void openInNewWindow(Widget widget) {
        Element ele = createWindow(widget.toString()
);
        MyWindow win = new MyWindow(ele);
        win.add(widget);
        win.toString();
    }

    private static class MyWindow extends ComplexPanel {
        public MyWindow(Element ele) {
            setElement(ele);
        }

        @Override
        public void add(Widget w) {
            add(w, getElement());
        }

    }

    private static native com.google.gwt.dom.client.Element createWindow(String htmlCode) /*-{
        myWindow = window.open("", "mywindow",
                "location=1,status=1,scrollbars=1,  width=100,height=100");
        myDiv = myWindow.document.createElement("div");
        myWindow.document.body.appendChild(myDiv)
        return myDiv;

    }-*/;
Reply all
Reply to author
Forward
0 new messages