Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT Popup window in new browser window

Tags:

gwt

I am trying to open new pop up window (browser window ) on click of button . Please suggest how to impement it.

like image 284
Abhay Avatar asked Nov 14 '09 18:11

Abhay


3 Answers

This should give you the basic idea on how to do this.

    Button openWindow = new Button("Open Window");
    openWindow.addClickHandler(new ClickHandler() {

        public void onClick(final ClickEvent clickEvent) {
            Window.open("http://google.com", "_blank", null);
        }
    });
    RootPanel.get().add(openWindow);
like image 121
bikesandcode Avatar answered Sep 20 '22 12:09

bikesandcode


Using Window.open() inside a Button's ClickHandler should do the trick.

like image 24
Upgradingdave Avatar answered Sep 18 '22 12:09

Upgradingdave


We have to use HTML's Target attribute to tell the browser,that where it should open.

Window.open("www.google.com","_blank","");

_blank Opens the linked document in a new window or tab

_self Opens the linked document in the same frame as it was clicked (this is default)

_parent Opens the linked document in the parent frame

_top Opens the linked document in the full body of the window

like image 45
Suresh Atta Avatar answered Sep 20 '22 12:09

Suresh Atta