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

Close parent window from child RadWindow

4 Answers 290 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kaushal
Top achievements
Rank 1
Kaushal asked on 01 Dec 2010, 05:39 AM
Hi ALL,

          I have one main page, main page have one button, on click of button i had open one RadWindow which have Add Operation,while user enter required information and try to click on Add button i had open third Child RadWindow for indicating progress, once progress will complete Progress and Add Window will close.

MainPage -> Click On Button -> Add Form -> Click On Save -> Progress Window Open -> Process Complete- > Progress and Add Form closed.

         Now what i want, when user click on Main Page Button child window will populate, once all information enter to Add Form user try to save it, once user click on save button progress window will get display from Add Form, here i need to close Add Form when progress popup will get display....

MainPage -> Click On Button -> Add Form -> Click On Save -> Progress Window Open -> Close Add Form->Process Complete- > Progress Window closed.

Please do me help to achieve this kind of functionality.

Thanks
Kaushal.

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Dec 2010, 10:39 AM
Hello Kaushal,


You can use the current RadWindow's (AddForm) parent window (Main page) as the parent of the new window (Progress window). And close the AddForm window using client code while opening the Progress window.

Here is the documentation which shows how to open window which is not linked to the intermediate window.
Opening a RadWindow from Within a RadWindow

For closing window, the code shown in the documentation will help.
Using RadWindow as a Dialog


-Shinu.
0
Kaushal
Top achievements
Rank 1
answered on 01 Dec 2010, 01:32 PM
Hi Shinu,

    Thanks for your reply, i gone through your refrence link, but it may be not usefull to me, let me explain clearly what i need.

All pages has been developed now i want to manage open-close sequence of each Parent-Child page..

I have total three pages...

Main.aspx

Child.aspx

Process.aspx

Current Scanario
 
            Main.aspx (Have button to open child page)

                    Chilc.aspx (User will come on this page while click on main page button, this page have save button, when user click on save button Process page get display)

                             Process.aspx(Processing, once process completed Process.aspx and Child.aspx get closed and user will redirect to Main.aspx)

Required Scanario
 
            Main.aspx (Have button to open child page)

                    Chilc.aspx (User will come on this page while click on main page button, this page have save button, when user click on save button Process page get display)

                             Process.aspx(Child.aspx should be close,Processing, once process completed Process.aspx get closed and user will redirect to Main.aspx)

Is this possible?

All the pages are related to his parent page and open from his parent page...

Like Process.aspx page will get open from Child.aspx and Child.aspx will get open from Main.aspx.
0
Accepted
Shinu
Top achievements
Rank 2
answered on 02 Dec 2010, 12:59 PM
Hello Kaushal,


I am sharing the code in detail. Hope this works for you.


In main page -  code for opening Child.aspx:
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
        <input id="Button1" type="button" value="openChild" onclick="openWindow();" />
 
<script type="text/javascript">
    function openWindow() {
        var radWin = window.radopen("../Child/Child.aspx");
    }
</script>


In the Child page, where you want to open another window which is Progress.aspx:
        Child.aspx
        <input id="Button1" type="button" value="Save" onclick="openProcess();" />
 
 
<script type="text/javascript">
    function openProcess() {
        var oManager = GetRadWindow().get_windowManager(); // Get the windowmanager on main page
        oManager.open("../Child/Process.aspx", "NewWindow");
    }
    function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow)
            oWindow = window.radWindow;
        else if (window.frameElement.radWindow)
            oWindow = window.frameElement.radWindow;
        return oWindow;
    
</script>
You can write the logic to close this window as soon as the operation completes (Call GetRadWindow().close() to close the window).

Now in Progress.aspx page:
       Process.aspx
        <input id="Button1" type="button" value="Close" onclick="openProcess();" />
 
 
<script type="text/javascript">
    function openProcess() {
        GetRadWindow().close(); // To close the window on button click
    }
    function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow)
            oWindow = window.radWindow;
        else if (window.frameElement.radWindow)
            oWindow = window.frameElement.radWindow;
        return oWindow;
    
</script>





-Shinu.
0
Kaushal
Top achievements
Rank 1
answered on 03 Dec 2010, 06:49 AM
Hi Shinu,

         Thanks a lot to shared your code to me, according to your code its seems to working fine.

        
Thanks
Tags
Window
Asked by
Kaushal
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Kaushal
Top achievements
Rank 1
Share this question
or