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

Cannot find window

3 Answers 92 Views
Window
This is a migrated thread and some comments may be shown as answers.
Matt Thrower
Top achievements
Rank 1
Matt Thrower asked on 22 Oct 2008, 12:56 PM
Hi,

I've got a composite control which contains a RadWindowManager and a RadWindow. It was using the older versions of the control and I initially swapped to the AJAX versions without trouble.

However the control is injecting some Javascript into the page which is no longer functioning. I have tried to get a reference to the RadWindow object using two different methods, both of which return a null object:

var oManager = GetRadWindowManager();
oManager.tile();
var oWnd = oManager.GetWindowById(windowName);
oWnd.show();  //errors as null object

var oWnd = $find('<%= _randWindow.ClientID %>');
oWnd.show(); //errors as null object

I've no idea why this occurring. What do I need to do to get the window object?

Cheers,
Matt

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 23 Oct 2008, 12:19 PM
Hi Matt,

You say that you inject the JavaScript which leads me to believe that this code is executed in window.onload, right? If this is so, please note that in ASP.NET AJAX, all ASP.NET AJAX controls (including ours) are created after the page is loaded - you can check that by examining the HTML dump of a page with Ajax controls on it.

In such scenario, I suggest to call the JavaScript code on a later stage - for example you can use timeout, the Sys.Application.add_load() function or the pageLoad() one.




All the best,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Matt Thrower
Top achievements
Rank 1
answered on 23 Oct 2008, 12:32 PM
Hi,

Thanks for the reply. The javascript isn't fired onload but with the onclick event of a control on the page.

However, the problem is certainly Ajax-related. The page contents were originally wrapped in a RadAjaxPanel - when I removed that, the problem disappeared.

However, ideally I'd like the page to be Ajax-enabled, so are there any other solutions I can explore?

Cheers,
Matt
0
Georgi Tunev
Telerik team
answered on 23 Oct 2008, 12:38 PM
Hello Matt,

In such case, please open a support ticket and send me a sample project where the problem can be reproduced - I will check it and get back to you with suggestions. Just make sure that the project can be run locally and attach it to the support thread.



Greetings,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Matt Thrower
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Matt Thrower
Top achievements
Rank 1
Share this question
or