locked
Telerik UI : Cannot read property 'radWindow' of null RRS feed

  • Question

  • User1904999316 posted

    Hi all,

    I am working on an old project and we're having an issue with telrik only in production. The radWindow opens up correctly but when we try to close it an errorr shows up:

    Uncaught TypeError: Cannot read property 'radWindow' of null

    This is the code for the called function:

    function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) {
                oWindow = window.radWindow;
            } else if (window.frameElement && window.frameElement.radWindow) {
                oWindow = window.frameElement.radWindow;
            } 
            return oWindow;
        }

    Then a .close() on the GetRadWinodw() function should close the popup. But what's weird is when I try on the console to get the "window.radWindow" it returns null and the "window.RadWindow" not null. 
    This is happening only on "NL" site and working on the other sites. I was thinking of case-sensitivity and also about setting some time out to load the object before calling the close() function, but as I said the same code is working on other sites...

    Any idea what could be causing behavior? and is there a way to inject some javascript into the live site to override the existing function?

    Thanks,

    Thursday, August 4, 2016 1:37 PM

All replies

  • User61956409 posted

    Hi medlag,

    window.radWindow

    Uncaught TypeError: Cannot read property 'radWindow' of null

    Firstly, please debug the code and add watches to object window to make sure if it contains a property named 'radWindow'.

    Secondly, it seems that we could get radWindow object via this code from client side.

    var oWnd = $find("<%= RadWindow.ClientID %>");

    Besides, you could ask for help on Telerik forum.

    http://www.telerik.com/forums/aspnet-ajax/window

    Best Regards,

    Fei Han

    Friday, August 5, 2016 7:03 AM
  • User1904999316 posted

    Hi Fei Han,

    Thank you for your reply.

    After some investigation it turns out that this has nothing to do with Telerik web ui because when I disable web security  (chrome.exe --disable-web-security --user-data-dir) everything starts working

    Any idea why I am having this issue (access denied to top.window.name , window.opener....) ? although I am on the same domain 

    Error: 

    "Uncaught SecurityError: Blocked a frame with origin  from accessing a frame with origin  The frame being accessed set "document.domain" to , but the frame requesting access did not. Both must set "document.domain" to the same value to allow access."

    FYI: as I mentionned before, this is working for other coutry sites with the same code! 

    Thanks,

    Friday, August 5, 2016 4:16 PM
  • User61956409 posted

    Hi medlag,

    I’d like to know if same issue will appear when you view web page in other major browsers, or it just appear in Google Chrome.

    Best Regards,

    Fei Han

    Tuesday, August 9, 2016 11:03 AM