This is a migrated thread and some comments may be shown as answers.

RadWindowManager OnClientClose

4 Answers 98 Views
Window
This is a migrated thread and some comments may be shown as answers.
JustinWong
Top achievements
Rank 1
JustinWong asked on 06 Dec 2010, 08:16 AM
In my OnClientClose client event of the RadWindowManager, I have codes that opens up another form using
var w = window.open(.....);
w.focus();

the window opens as it should, however, the focus is always returned to the calling form  (i.e.: the window opens, but is immediately minimized).  This only happens if window.open is called from the RadWindowManager's OnClientClose event.  If I use the same code (var w = window.open(....); w.focus();) elsewhere, it works as it should.  Is there something with RadWindowManager that forces focus back to the main form at the end of OnClientClose event?  If so, how can I overcome that?

Thanks!

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 06 Dec 2010, 09:55 AM
Hello JustinWong,

I am not sure what your exact setup is, but at this point I would suggest to try using a small timeout
...........
window.setTimeout(function ()
{
    var w = window.open(.....);
    w.focus();
}, 100;);
...........

If this doesn't help, please submit a support ticket with a sample project so I can check it.

Regards,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
JustinWong
Top achievements
Rank 1
answered on 06 Dec 2010, 04:07 PM
Thanks Georgi. That worked!  Now, for the education part:  Why would imposing a delay makes a difference?

Thanks!

Justin
0
Georgi Tunev
Telerik team
answered on 07 Dec 2010, 02:26 PM
Hello Justin,

Lucky guess maybe? ;)

Seriously, I am not familiar with your exact setup and if you execute other code in OnClientClose, but I assumed that the RadWindow is modal - sometimes it happens so that the modal layer is still present on the page while code in OnClientClose is executed and when the layer is removed, the browser automatically returns the focus to the parent page. There are couple of other scenarios where a problem with focus might occur (e.g. opening a modal RadWindow from within another RadWindow by clicking on an imagebutton), but I decided to suggest the timeout first :D


Best wishes,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
JustinWong
Top achievements
Rank 1
answered on 07 Dec 2010, 04:43 PM
Thanks Geogi. Great explanation. I really appreciate that. YOU THE MAN!

Justin
Tags
Window
Asked by
JustinWong
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
JustinWong
Top achievements
Rank 1
Share this question
or