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

RadWindow reopens after close

6 Answers 150 Views
Window
This is a migrated thread and some comments may be shown as answers.
Nicholas
Top achievements
Rank 1
Nicholas asked on 27 Feb 2008, 10:20 AM
Hi

I am using the SizeToFit() javascript function to resize my RadWindow when it opens as per the

I have an AjaxManager which I use the ResponseScripts to execute GetRadWindow().Close(); after saving the changes server side.

The problem is that the RadWindow closes for a second then reopens.

If I remove the SizeToFit function, it works ok.

How can I get round this?

Thanks

Nick

6 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 27 Feb 2008, 03:37 PM
Hello Nick,

Since we are not sure about yout exact setup we were unable to reproduce the reported problem.

Could you please specify more information about the issue? We also kindly request you to send us a sample runnable project demonstrating the issue. Then we will be able to track it and to give you a proper reply right away.

Best wishes,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Nicholas
Top achievements
Rank 1
answered on 27 Feb 2008, 04:04 PM
Hi

I've opened a support ticket with the sample project.

Ticket No 124053

Thanks

Nick
0
George
Telerik team
answered on 28 Feb 2008, 08:23 AM
Hello Nick,

Thanks for your sent project, you will find the solution attached in the support ticket.

Greetings,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
mb
Top achievements
Rank 1
answered on 29 Feb 2008, 10:45 AM
what was the solution here?

We are using the provided js code to close RadWindow via standard form button.

- It works in FireFox but not in IE
- No Ajax on the page
- The RadWindow immediately reloads (only in IE)

What is the fix?
0
Nicholas
Top achievements
Rank 1
answered on 29 Feb 2008, 11:41 AM
Hi mb

Heres the updated code from my <head> script.

        <script type="text/javascript">  
        function GetRadWindow()  
        {  
           var oWindow = null;  
           if (window.radWindow) oWindow = window.radWindow;  
           else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
           return oWindow;  
        }  
 
        function CloseOnReload() {  
            setTimeout(function()  
            {  
                GetRadWindow().Close();  
            },800);  
        }  
        </script> 
 

And the resize window script from the <body onload="SizeToFit()">

        <script type="text/javascript">  
      function SizeToFit()  
      {  
       window.setTimeout(  
           function()  
           {  
               var oWnd = GetRadWindow();  
 
               oWnd.SetWidth(document.body.scrollWidth + 40);  
               oWnd.SetHeight(document.body.scrollHeight + 70);  
               oWnd.show();  
               oWnd.center();  
           }, 400);  
      }  
      </script> 
 

Hope that helps

Regards

Nick
0
mb
Top achievements
Rank 1
answered on 29 Feb 2008, 12:39 PM
Thanks for the quick reply Nick.

It seems my issue was something else.  I don;t yet know why , but apparently I had a cross domain problem.  I will look at it again later because I am not seeing why.

I had to add :

document.domain = "samedomainascallerhere";

on the rad widow page. 

- Both the caller and rad window page are on the same domain
- The only js done on the rad window page is the GetRadWindow.close(); call

Tags
Window
Asked by
Nicholas
Top achievements
Rank 1
Answers by
George
Telerik team
Nicholas
Top achievements
Rank 1
mb
Top achievements
Rank 1
Share this question
or