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

Close RadWindow in FireFox

1 Answer 62 Views
Window
This is a migrated thread and some comments may be shown as answers.
D O
Top achievements
Rank 1
D O asked on 09 Apr 2011, 11:37 PM
Hi there

I'm unable to close a RadWindow in FireFox using an HTML image with onclick="Close();".  It works fine in all other browsers.

This is the javascript that I have on the page that's opening in the RadWindow:

 

 

 

<script language="javascript" type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog       
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow; //IE (and Moz as well)       
            return oWindow;
        }
  
        function Close() {
            GetRadWindow().Close();
        }           
</script>

 

 

I close the Radwindow using this code:

<img alt="Close Window"  src="closebutton.jpg" onclick="javascript:Close();" style="cursor: pointer" />

As I said, this works fine in all browsers except for FireFox.  I get a java error GetRadWindow() is undefined when I click the Close button in FireFox.

Just for information sake, this is my RadWindowManager code on the content page:
<telerik:RadWindowManager Width="620px" Height="495px" ReloadOnShow="true" 
       ShowContentDuringLoad="false" AutoSize="true" VisibleTitlebar="False" 
       VisibleStatusbar="false" Modal="true" ID="RadWindowManager1" runat="server">
   </telerik:RadWindowManager>

I invoke the RadWindow from the content page like this:
<img src="site/interface/quote.jpg" style="cursor: pointer" onclick="radopen('quote.aspx?p=<%=productname%>');" />

I've tried everything, hope someone here can help!  I'm using 2010 Q3 controls for ASP.NET Ajax in VB.NET.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Apr 2011, 07:40 AM
Hello,

In the GetRadWindow() function, the radWindow property is used to reference the frame which is the RadWindow. This property is dynamically set by the RadWindow's source code and since javascript is case sensitive it must be used with the very same casing.

In your code you have mistyped it with a capital R below:

javascript:

if (window.radWindow)
     oWindow = window.RadWindow;

The correct code is:
function GetRadWindow()
{
  var oWindow = null;
  if (window.radWindow)
     oWindow = window.radWindow;
  else if (window.frameElement.radWindow)
     oWindow = window.frameElement.radWindow;
  return oWindow;
}

Thanks,
Shinu.
Tags
Window
Asked by
D O
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or