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

Client-side DOM access to RadWindow elements

2 Answers 221 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 11 Aug 2008, 09:45 AM

I'm having difficulties accessing the client document object in a RadWindow. The Javascript Forms object is zero length and document.getElementById() doesn't find my controls either.

I've also noticed that the Sys object isn't availble, so I can't use Sys.UI.DomEvent.addHandler to create code for the Window load event (I've used this elsewhere to set the intial disabled state of a couple of buttons on my page).

My window, wndCashDetail, is declared in RadWindowManager:

<telerik:RadWindowManager ID="RadWindowManager1"   
                          Width="1200px"   
                          Height="500px"   
                          Modal="true" 
                          runat="server"   
                          Behavior="Move" 
                          OnClientClose="closeDetailsWindow"   
                          DestroyOnClose="True"   
                          ReloadOnShow="True"   
                          Title="Cash Detail"   
                          VisibleStatusbar="False" Skin="Office2007">  
</telerik:RadWindowManager>  

My window is opened by a client side call as follows:

var oWnd = window.radopen(URL, "wndCashDetail" ); 

At the top of my window I want to run the following script to add a window load event handler:

Sys.UI.DomEvent.addHandler(window"load", DisableFunctionalityButtons); 

This does not work though - I get 'Sys is undefined'. Also, document.forms.count is zero, and I can't find any of my controls with document.getElementById().

I think I must be missing something fundamental here. Is the normal DOM not available in modally opened RadWindows?

Rob

2 Answers, 1 is accepted

Sort by
0
Accepted
Angela
Top achievements
Rank 1
answered on 11 Aug 2008, 09:15 PM
Try putting your javascript at the end of the page in a script tag.  I beleive you need to do this inorder to use any dynamic javascript on the client side
0
Rob
Top achievements
Rank 1
answered on 12 Aug 2008, 11:05 AM
Spot on Angela, thanks.
Tags
Window
Asked by
Rob
Top achievements
Rank 1
Answers by
Angela
Top achievements
Rank 1
Rob
Top achievements
Rank 1
Share this question
or