Feb 20, 2013

How to pass argument from Rad popup window to parent window

Below is an example that demonstrates how to pass an argument from the rad pop window to parent window and based on the argument we should refresh the page.

On the pop up window call the pageload method like

<body onload="pageload();">

and call the close popup method from button click.

then use the script as below
var oWnd;
        function closePopup(URL) {

            oWnd.argument = "Refresh"; // Set the updated value in button click
        function pageLoad() {
            oWnd = GetRadWindow();

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

On the parent window onclientclose method get the argument and based on the argument i am reloading the page.

          function OnClientClose(oWnd) {
              var arg = oWnd.argument;
            oWnd.setUrl("about:blank"); // Sets url to blank
              if(arg.toString() == 'Refresh')
               //remove the close handler - it will be set again on the next opening

No comments: