Tuesday, July 26, 2011

Re: Opening new browsers window blocked inside GWT application

You can't open a window outside of the event handler for the click
event or it will be blocked. Here are 2 options that might work:

1) Open the window with a URL passing enough context to determine the
final destination. Your server could respond with a redirect if
necessary.

2) Open the window with a simple URL that renders a blank page or a
"Loading..." page and then modify the location on the window after
your RPC returns. You'll need to write some JSNI code because the GWT
Window.open returns void. The real Javascript window.open returns a
reference to the new window and you can use that reference to change
the location.

-Andy

On Jul 26, 10:52 am, Ahmed <ahmed.zar...@gmail.com> wrote:
> Hello,
> In my gwt, when a clickEvent is fired, i create a webapp using rpc
> that i deploy on server and i return the url which i used to open a
> new window...I have to do some process before opening new window , I
> know it's because of that that browsers block the page but I do not
> know how to make it functional.
>
>  url= someProcess();
>  Window.open(url, "Test ", "");
>
> is there any tricks to make the popup not blocked? Thanks in advance
> for your helps

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment