PDA

View Full Version : [CLOSED] window.open Popup



cwolcott
Apr 15, 2015, 12:13 AM
When I press an ImageButton I show the contents of an html file via window.open. Everything works fine in Chrome, IE and Firefox.

I also look at the ClientQueryString to determine if I need to show an html file and this is where I run into a issue. I tried the following, but each call is causing the Popup blocker to block the window.open.



if (ClientQueryString.Length > 0)
{
// X.Js.Call("showInfo");
// MessageBus.Default.Publish("Popup.Archives");
// MessageBus.Default.Publish("Popup.ArchivesClick");
}



Call the javascript directly;
Send a message on the bus and call the javascript function;
Send a message on the bus and fire the click event on the ImageButton;


I guess I can't mimic the ImageButton click so that the window.open isn't blocked.

Daniil
Apr 15, 2015, 2:04 PM
Hi Chris,

Yeah, a browser block a popup that is done in the context of AJAX request.

Curious, does this work for you?

X.Js.AddScript("setTimeout('showInfo();', 100);");

Daniil
Apr 15, 2015, 7:33 PM
I feel you might not got a notification about my answer. So, posting a follow-up.

cwolcott
Apr 17, 2015, 1:17 PM
No ... the suggestion did not work either.

X.Js.AddScript("setTimeout('showInfo();', 100);");

I also tried:


MessageBus.Default.Publish("Popup.ArchivesClick");


Where the MessageBus listener performed:


<ext:MessageBusListener Name="Popup.ArchivesClick" Handler="App.mpInfo.el.dom.click();" />


Since pressing the ImageButton directly showed the contents of an html file via window.open without any popup blocker I was hoping that I could do the same thing during the Page_Load while interpreting the ClientQueryString. But it doesn't seem possible.

One thing that I didn't mention above is when I call the window.open I am using the third parameter to set various attributes for the window (such as window width & height, top & left, screen & screen, scrollbars and resizable).

If you have no more suggestions you can close the thread.

Daniil
Apr 17, 2015, 1:45 PM
Could you, please, provide an exact test case to reproduce the problem? To avoid misunderstanding. I would take a look in greater details.