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

Problem with Chrome and oWindow.close();

2 Answers 101 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ashim
Top achievements
Rank 1
Ashim asked on 26 Jul 2011, 09:45 PM
when in my Window i call oWindow.close(); it works perfect for both IE/89 and Mozila 4/5
but in Chrome somthing funny is happening. it closes the window then it opens an empty  window !!!

this is how i call the window (MainPage.aspx)

            <telerik:RadWindow ID="RadWindow_QuikInfo" runat="server" Behavior="Default" InitialBehavior="None"
                    ShowContentDuringLoad="false" OpenerElementID="Button1" 
                    VisibleOnPageLoad="false" NavigateUrl="~/Win1.aspx" 
                    Behaviors="Close,Move,Resize,Reload" >
            </telerik:RadWindow>

and this is how i try to close window (Win1.Aspx)

            function AdjustRadWidow() {
                var oWindow = GetRadWindow();
                if (1 == 1) oWindow.close();
                setTimeout(function () { oWindow.autoSize(true); if ($telerik.isChrome || $telerik.isSafari) ChromeSafariFix(oWindow); }, 500);
            } 

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 27 Jul 2011, 04:35 PM
Hello Ashim,

  Let me start by pointing out that you shouldn't call all these methods after you have closed the RadWindow, as they are designed to work for a shown RadWindow. I believe you have taken the ChromeSafariFix() function from our online demo where it is used to properly resize a RadWindow when popups are shown inside and it is most likely not necessary after the RadWindow has been closed :)

More specifically the RadWindow is shown again due to the center() function, as it internally manages the visibility of the popup.

All that being said what I would advise is that you modify your logic so that these functions are not called after the close() function, for example:
function AdjustRadWidow()
{
    var flag = false; //determine what shall be done according to your custom logic
    //either the RadWIndow shall be closed, or it shall be resized
    var oWindow = GetRadWindow();
    if (flag)
    {
        oWindow.close();
    }
    else
    {
        setTimeout(function () { oWindow.autoSize(true); if ($telerik.isChrome || $telerik.isSafari) ChromeSafariFix(oWindow); }, 500);
    }
}



Greetings,
Marin
the Telerik team

Browse the vast support resources we have to jump start 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
Ashim
Top achievements
Rank 1
answered on 28 Jul 2011, 01:06 AM
Thanks , It worked fine
Tags
Window
Asked by
Ashim
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Ashim
Top achievements
Rank 1
Share this question
or