RadControls for ASP.NET AJAX
By obtaining a reference to a RadWindow component, you can call any function that is defined in that windows content window.
Just use the contentWindow property to reference the Content Window of the page loaded inside the RadWindow.
The example below shows one way to get a reference to the RadWindow with server ID RadWindow1. This approach may vary according to the scenario.
You can also see how you can pass information along to the other function. Passing an argument is not necessary, but it is an easy way to transfer information
between different pages. Another approach to pass data to and from a RadWindow is shown in
this help article.
CopyJavaScript
function CallFn()
{
var oWnd = GetRadWindowManager().getWindowByName("RadWindow1");
var myData = "some information";
oWnd.get_contentFrame().contentWindow.CalledFn(myData);
}
function CalledFn(data)
{
alert(data);
}
Using this technique lets you call functions in a RadWindow's parent window or in a sibling window:
CopyJavaScript
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function CallFnOnParent()
{
GetRadWindow().BrowserWindow.CalledFn();
}
function CallFn()
{
var oWnd = GetRadWindow();
var dialogB = oWnd.get_windowManager().getWindowByName("RadWindow1");
dialogB.get_contentFrame().contentWindow.CalledFn();
}
The approach from the first code snippet can be used in a similar way to pass data to the functions you call. Getting a reference to the sibling RadWindow may vary
with the scenario (e.g. $find() can be used, a reference can be previously stored in a global variable, etc.).