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

How to raise an event of a control in a radWindow from another radWindow

2 Answers 69 Views
Window
This is a migrated thread and some comments may be shown as answers.
Joseph Ambattu
Top achievements
Rank 1
Joseph Ambattu asked on 22 Jan 2010, 10:27 AM
Hi,
    I am using the following code to open a radWindow from another radWindow:

  function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        }

        function openRadWin(accid, grporhd, contmenutxt)
        {
            var oManager = GetRadWindow().get_windowManager();
            oManager.open('/Demo/frmAccount.aspx?id=' + accid + '&grporhd=' + grporhd + '&contmenu=' + contmenutxt, "RadWindow2");
        }       

I am calling openRadWin() on the click event of a button in the parent radWindow ( code given below ) to call the second radWindow (ie. RadWindow2)

I am using the following code to open the parent radWindow:
 
            RadWindow newWindow = new RadWindow();
            newWindow.Title = "Chart of Account";
            newWindow.Skin = "Forest";
            newWindow.NavigateUrl = "~/ChartOfAccountTest.aspx";
            newWindow.Top = Unit.Pixel(50);
            newWindow.VisibleOnPageLoad = true;
            newWindow.Behaviors = WindowBehaviors.Move | WindowBehaviors.Close | WindowBehaviors.Minimize | WindowBehaviors.Reload;
            newWindow.Left = Unit.Pixel(200);
            newWindow.Width = Unit.Pixel(650);
            newWindow.Height = Unit.Pixel(500);
            RadWindowManager1.Windows.Add(newWindow);

The javascript given in the beginning is put in the script section of ChartOfAccountTest.aspx .  I want to raise an event of CharOfAccountTest.aspx when the second radWindow (ie. RadWindow2) is closed.  Please suggest me a solution to implement this. Any help will be highly appreciated.

Joseph

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 22 Jan 2010, 11:44 AM
Hello Joseph,

You can attach OnclientClose() event to the radwindow from client side when it is opening. The following documentation will help you in this.
Setting client events by using Javascript

And the following online documentation describes how to call functions between windows.
Calling Functions in Windows

-Shinu.
0
Joseph Ambattu
Top achievements
Rank 1
answered on 22 Jan 2010, 12:55 PM
Hi Shinu,
    I followed the links you suggested and found the solution.  Thank you very much for the fast response.

Joseph


                     


Tags
Window
Asked by
Joseph Ambattu
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Joseph Ambattu
Top achievements
Rank 1
Share this question
or