Hello all,
I can't seem to get Chrome to open a new window using the
Window.open() function.
It seems to work fine if the function is called from a click handler,
but not when called directly.
Using Firefox and Internet Explorer the following code launches a
window on load and a new window each time
the button is pressed.
public void onModuleLoad()
{
Window.open("
http://www.google.com", "_blank", "");
Window.alert("Opened window");
Button btn = new Button("Launch Window!");
btn.addClickHandler( new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
Window.open("
http://www.google.com", "_blank", "");
Window.alert("Opened window");
}
});
RootPanel.get().add( btn );
}
In Chrome, a window is not launched on load, however when the click
event occurs, it works fine.