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

Getting a reference of a RadWindow

3 Answers 161 Views
Window
This is a migrated thread and some comments may be shown as answers.
mvbaffa
Top achievements
Rank 1
mvbaffa asked on 23 May 2009, 01:13 AM
Hi,

I am trying to get a reference of a RadWindow but the $find returns null on form load. My radwindow is like this:
 < telerik:RadWindow ID="rwinLogOn" Title="asset Toolbox - LogOn" runat="server"

 

 

NavigateUrl="LogOn.aspx" Behavior="None" IconUrl="img/userGroup.png"

 

 

 

VisibleStatusbar="False" DestroyOnClose="True"

 

 

 

OnClientClose="onClientClose" Modal="False" Skin="Black" Height="160"

 

 

 

Width="230" AutoSize="True" style="display: none">

 

 

 

</telerik:RadWindow>

 

 

 

It is a logon window and must be opened at the start of the application. When the first form is opened. I am using jQuery and I have a ready event like this:
$(document).ready(

 

 

function() { 

   showLogOn();

});

 

 

function showLogOn() {

 

 

 

var oWnd = $find("rwinLogOn");

 

 

oWnd.show();

}

 

 

The oWnd variable in showLogOn is allways returning "null" at the form load. To check if the problem was really because of the form load event I put a button in the main form like this:
<input id="btnShow" type="button" value="show window" onclick="showLogOn(); return false;" />

 

 

 

When the form is loaded normally and I press the button above the RadWindow is showned without any problems. So the problem is really because the RadWidown is not avaiable at the jQuery ready event.

I tried to call showLogOn() in the Body onLoad and OnInit events and it did not worked. The curious thing is that all other html tags can be accessed normally in the jQuery ready event. But the RadWindow is only avaiable after the page is displayied.

I need to know which event I must drive to access the radWindow after the form is completelly loaded.

Thanks in advance.

 

3 Answers, 1 is accepted

Sort by
0
Phil
Top achievements
Rank 2
answered on 24 May 2009, 03:59 PM
Hi:

Search for the following, under the this RadWindow section:
window.radWindow
or
window.frameElement.radWindow
This is in the context of the current RadWindow.  You can find yourself to close or print, etc.
I would start with:
http://www.telerik.com/community/forums/aspnet-ajax/window/how-to-print-the-parent-window-from-radwindow.aspx



Phil
0
Georgi Tunev
Telerik team
answered on 25 May 2009, 05:40 AM
Hi Phil,

If you want to use JavaScript to open the window, I suggest using ASP.NET AJAX's pageLoad() function - it is automatically fired when all ASP.NET AJAX controls are loaded on the page. Note that the ASP.NET AJAX controls are loaded on a later stage in page's life cycle (after window.onload is fired), in the Sys.Application.Load() event.
As an alternative you could simply set the VisibleOnPageLoad property of the RadWindow to true - this way once the control is loaded on the page, the RadWindow will automatically be displayed.


Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
mvbaffa
Top achievements
Rank 1
answered on 25 May 2009, 11:37 PM
Thanks I will try it out    
Tags
Window
Asked by
mvbaffa
Top achievements
Rank 1
Answers by
Phil
Top achievements
Rank 2
Georgi Tunev
Telerik team
mvbaffa
Top achievements
Rank 1
Share this question
or