Object doesn't support property or method 'add_show'

5 posts, 1 answers
  1. Suzy
    Suzy avatar
    66 posts
    Member since:
    Nov 2014

    Posted 10 Mar 2015 Link to this post

    Hi

    I'm using add_show from Radwindow but sinds installing version UI for ASP.NET AJAX Q1 2015, I get following error :

    Object doesn't support property or method 'add_show'


    This is the javascript function I use it in it:

    function openChildDialog(url, wndName, title) {
        if (!url)
            url = "errorPage.aspx";
        if (!wndName)
            wndName = "popup_" + Math.random();
        var currentWnd = GetRadWindow();
         
        var browserWnd = window;
        if (currentWnd)
            browserWnd = currentWnd.BrowserWindow;
        setTimeout(function () {
            browserWnd.add_show(returnDataToParentPopup);
            var wnd = browserWnd.radopen(url, wndName);
            wnd.__parentBackReference = window; //pass the current window object of the page that opens the dialog so it can be used later
     
            if (title)
                wnd.set_title(title);
        }, 0);


    Can someone please help me? It is urgent because no window is opening in my production environment!

    Kind regards

    Suzy
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 10 Mar 2015 Link to this post

    Hi Suzy,

    This should never have worked, because the browser window object does not have an add_show() method, only RadWindow instances do. Moreover, you should not add handlers to an instance created in the main page from inside the iframe. These are two different contexts and this can break. Please refer to the code library that explains how to create parent-child relationships between windows for details on how to do this properly by using the events of the RadWIndows in the proper context.

    Regards,

    Marin Bratanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Suzy
    Suzy avatar
    66 posts
    Member since:
    Nov 2014

    Posted 10 Mar 2015 Link to this post

    HI Marin,

    I used that page to implement this??? 
  5. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 10 Mar 2015 Link to this post

    Hello Suzy,

    Here is the function from the code library:

    function openChildDialog(url, wndName, title) {
        //in case of erroneous arguments, add some error handling and prevention
        if (!url)
            url = "errorPage.aspx";
        if (!wndName)
            wndName = "popup_" + Math.random();
        var currentWnd = GetRadWindow();
        var browserWnd = window;
        if (currentWnd)
            browserWnd = currentWnd.BrowserWindow;
        setTimeout(function () {
            var wnd = browserWnd.radopen(url, wndName);
            wnd.__parentBackReference = window; //pass the current window object of the page that opens the dialog so it can be used later
     
            if (title)
                wnd.set_title(title); //you can pass more parameters for RadWindow settings, e.g., modality, dimensions, etc.
            //you can even add arguments that will pass data from the parent to the child as shown here
            //in the On the Dialog Page section that shows how to access custom fields in the RadWindow object and use them.
            //of course, you can also use querystrings in the URL.
        }, 0);
    }

    The add_show() call is not part of it.

    Regards,

    Marin Bratanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Suzy
    Suzy avatar
    66 posts
    Member since:
    Nov 2014

    Posted 10 Mar 2015 Link to this post

    I was just checking the post again and indeed that line is not in your example.  I know when I implemented it I have tested a lot of different scenario's and I think that part is from a test that I forgot to remove or something like that.

    Sorry for that!

    I will remove that line and check if everything is still working..
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017