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

Object doesn't support property or method 'add_show'

4 Answers 69 Views
Window
This is a migrated thread and some comments may be shown as answers.
Suzy
Top achievements
Rank 2
Suzy asked on 10 Mar 2015, 10:01 AM
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

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 10 Mar 2015, 01:56 PM

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.

 
0
Suzy
Top achievements
Rank 2
answered on 10 Mar 2015, 02:24 PM
HI Marin,

I used that page to implement this??? 
0
Accepted
Marin Bratanov
Telerik team
answered on 10 Mar 2015, 03:01 PM

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.

 
0
Suzy
Top achievements
Rank 2
answered on 10 Mar 2015, 03:05 PM
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..
Tags
Window
Asked by
Suzy
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Suzy
Top achievements
Rank 2
Share this question
or