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

opening RadWindow form page loaded in another RadWindow

5 Answers 133 Views
Window
This is a migrated thread and some comments may be shown as answers.
piotre6
Top achievements
Rank 1
piotre6 asked on 23 Jan 2012, 08:01 AM
I have a page with agreement control, from that page I open a RadWindow with control to create or edit tenant details.
Tenant control contain antoher RadWindow to edit adress details (as on attahed picture)
How can I make RadWindow with address control to be above the tenant control?

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Jan 2012, 08:13 AM
Hello,

Take a look at the following demo.
Grid / Window Editing

-Shinu.
0
piotre6
Top achievements
Rank 1
answered on 23 Jan 2012, 08:53 AM
scenario from link you posted has only one radwindow.
it would be similar if you had another radwindow in editformcs.aspx
0
Marin Bratanov
Telerik team
answered on 23 Jan 2012, 05:04 PM
Hi,

Please examine this help article: http://www.telerik.com/help/aspnet-ajax/window-programming-opening-from-within-dialog.html. It explains this exact scenario (that an object is confined in its parent frame) and how to avoid it (by opening the second RadWindow from the parent page). An alternative would be, just as Shinu suggested, to use the first RadWindwo with its ContentTemplate so that it does not create a new iframe. The difference between both modes is explained in this online demo.


All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
piotre6
Top achievements
Rank 1
answered on 23 Jan 2012, 10:54 PM

I think the article could help however in code :

var oBrowserWnd = GetRadWindow().BrowserWindow;
setTimeout(function ()
{
    oBrowserWnd.radopen("http://www.google.com", "NewWindow");
}, 0);

I get radopen is undefined.

I cannot use contenttemplate due to multiple recurrency.
0
piotre6
Top achievements
Rank 1
answered on 23 Jan 2012, 11:29 PM

Thank you for your suggestions, everything is fine now,
Error "radopen is undefined" dissapeared after adding RadWindowManager.

example if anybody needs it:
test1.aspx

<telerik:RadScriptBlock runat="server" ID="test1_script">
    <script type="text/javascript">
        var test1Wnd;
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog       
            else if (window.frameElement && window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow; //IE (and Moz as well)       
            return oWindow;
        }
        function open_fromTest1() {
            var oBrowserWindow = GetRadWindow();
            if (oBrowserWindow) oBrowserWindow = oBrowserWindow.BrowserWindow;
            if (oBrowserWindow == null) window.radopen("test2.aspx", "NewWindow1");
            else {
                setTimeout(function () {
                    test1Wnd = oBrowserWindow.radopen("test2.aspx", "NewWindow1");
                }, 0);
            }
        }
    </script>
</telerik:RadScriptBlock>
<div>
    TEST1
    <telerik:RadButton ID="RadButton1" Text="Open window" runat="server" 
        AutoPostBack="false" OnClientClicked="open_fromTest1" />
</div>
<telerik:RadWindowManager runat="server" ID="test1wndmgr"></telerik:RadWindowManager>

test2.aspx
<telerik:RadScriptBlock runat="server" ID="test1_script">
    <script type="text/javascript">
        var test2Wnd;
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog       
            else if (window.frameElement && window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow; //IE (and Moz as well)       
            return oWindow;
        }
        function open_fromTest2() {
            var oBrowserWindow = GetRadWindow();
            if (oBrowserWindow) oBrowserWindow = oBrowserWindow.BrowserWindow;
            if (oBrowserWindow == null) window.radopen("test3.aspx", "NewWindow2");
            else {
                setTimeout(function () {
                    test1Wnd = oBrowserWindow.radopen("test3.aspx", "NewWindow2");
                }, 0);
            }
        }
    </script>
</telerik:RadScriptBlock>
<div>
    TEST2
    <telerik:RadButton Text="Open window" runat="server" 
        AutoPostBack="false" OnClientClicked="open_fromTest2" />
</div>
<telerik:RadWindowManager runat="server" ID="test1wndmgr"></telerik:RadWindowManager>


test3.aspx
<div>
    TEST3
</div>
Tags
Window
Asked by
piotre6
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
piotre6
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or