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

[Solved] upgrade probs with GetRadWindowManager()

4 Answers 205 Views
Window
This is a migrated thread and some comments may be shown as answers.
Bexm
Top achievements
Rank 1
Bexm asked on 30 May 2008, 09:58 AM
Hello

I have been tasked with upgrading all the telerik controls on our project to the new prometheus ones..
So far it is mostly going smoothly but I am having problems with the rad windows.
Everywhere I have "GetRadWindowsManager()" it has stopped working. This is always returning null.

I have read the post here,
http://www.telerik.com/community/forums/thread/b311D-beacgk.aspx

that is having a similar problem, and have tried adding Sys.Application.add_load(
around some of the calls to the window I am trying to open, but it still doesn't work.

One example of where it is used..

The open window JS function:

function openWindow(ID){
var manager = GetRadWindowManager();
var win = manager.GetWindowByName('OrderPreview');
win.SetUrl(
"/orderDetailPreview.aspx?ID=" + ID, "Order Details");
win.Show();
}

and within a radgrid is 

<Telerik:GridTemplateColumn>
<ItemTemplate>
<a href="javascript:openWindow('<%#DataBinder.Eval(Container.DataItem,"OrderDetailId") %>')">view</a>
</ItemTemplate>
</Telerik:GridTemplateColumn>


This method is used on numerous pages throughout our project so alot of things are now broken..

Please can you advise how I initilize the GetRadWindowManager() function so it will work..

Thanks

Bex

4 Answers, 1 is accepted

Sort by
0
Bexm
Top achievements
Rank 1
answered on 30 May 2008, 01:02 PM
Just to add.. these functions and controls are in a usercontrol...if it makes any difference?
0
Svetlina Anati
Telerik team
answered on 02 Jun 2008, 02:19 PM
Hello Bexm,

I examined your code and tested the GetRadWindowManager method in a user control - it worked as expected. I assume that the problem comes from the way you want to reference the window - I suggest to try to do it by using the following code:

function openWindow()  
 
{  
    var manager = GetRadWindowManager();  
    var win = manager.GetWindowById("<%=RadWindow1.ClientID %>");  
    win.SetUrl("http://www.google.com");  
    win.Show();  
}   
 

Please, note that you should use the RadWindow's ClientID because the User Control is an INamingContainer and modifies the content controls' IDs. This being said if you just set the window's ID as a string you will receive null as result because the actual ID is different and such window can not be find.

For your convenience I am attaching a sample demo project.


Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bexm
Top achievements
Rank 1
answered on 03 Jun 2008, 08:41 AM

Thank you for the example.

I forgot to mention in my original post that this page is also on a master page, which also has a rad window manager on it which has the sites default pop ups.

As soon as I commented this the windows on the content pages started working.

So now my question is, can I still have a radwindowmanager on both the master page and a content page? or am I only allowed 1? As they seem to be conflicting.

I am really not sure what I am going to do if it has changed and I am only allowed 1 rad window manager? It will cause me to re-write the whole project.

If this is not the case, is there a specific way I need to use the rad window manager if I have one on the master and one on the content?

Thanks in advance

Bex

0
Svetlina Anati
Telerik team
answered on 04 Jun 2008, 10:36 AM
Hello Bexm,

When you have one RadWindowManager on your MasterPage and another one on the ContentPage you actually get a resultant page with two RadWindowManagers. There is no problem to have more than one RadWindowManagers on a single page but only the first one will be active if you use the RadWindowManager for ASP.NET AJAX. When having the same situation with the RadWindowManager for ASP.NET, the active control will be the last created RadWindowManager.

This being said I assume that the RadWindowManager which is last created on your page contains the OrderPreview window and it will work with the ASP.NET version of the control. When you have upgraded to the ASP.NET AJAX version, the first manager has become active and you receive the null error because it does not contain a definition for OrderPreview window. What I can suggest is to rework your project based on this information in the most convenient for you manner.


Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Bexm
Top achievements
Rank 1
Answers by
Bexm
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or