RadWindowManager OnClientClose

5 posts, 0 answers
  1. JustinWong
    JustinWong avatar
    147 posts
    Member since:
    Mar 2007

    Posted 06 Dec 2010 Link to this post

    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!
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 06 Dec 2010 Link to this post

    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.
  3. JustinWong
    JustinWong avatar
    147 posts
    Member since:
    Mar 2007

    Posted 06 Dec 2010 Link to this post

    Thanks Georgi. That worked!  Now, for the education part:  Why would imposing a delay makes a difference?

    Thanks!

    Justin
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 07 Dec 2010 Link to this post

    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.
  5. JustinWong
    JustinWong avatar
    147 posts
    Member since:
    Mar 2007

    Posted 07 Dec 2010 Link to this post

    Thanks Geogi. Great explanation. I really appreciate that. YOU THE MAN!

    Justin
Back to Top