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

set_status after redirect

2 Answers 37 Views
Window
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 01 Aug 2012, 03:13 AM
I am opening a RadWindow that starts a modal dialog I am using as a 4-step wizard.

The code on the page that launches the wizard does a set_status to successfully set the status to read "Step 1 of 4":

var oWnd = $find("<%=radNewProjectWizard.ClientID%>");
oWnd.show();
oWnd.set_title("New Project Wizard");
oWnd.MoveTo(482, 100);
oWnd.add_pageLoad(function () { oWnd.set_status("MyProject"); });
oWnd.add_close(NewProject_OnClientClose);


When the user clicks "next" I do a redirect to the next .aspx page in the series and want to update the status to "Step 2 of 4".

I am unable to refresh the status - it still says "Step 1 of 4".

The code I am using in step2.aspx is as follows:

<body onload="OnLoad()">
  
<...>
  
function OnLoad() {
            GetRadWindow().set_status("Step 2 of 4");
        }
  
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.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)  
            return oWindow;
        }

I would assume the GetRadWindow gets a reference to the parent page (the RadWindow) and I should be able to do a set_status to update the status bar, but this doesn't seem to be the case.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Aug 2012, 09:46 AM
Hello,

I also observed the same behavior. You should ensure that your status is set after the automatic one. In order to do so you  can set it in the PageLoad event with a small timeout (actually a timeout of 0 will also do the trick).

Javascript:
setTimeout(function () {
                GetRadWindow().set_status("Step 2 of 4");
            }, 0);

Thanks,
Princy.
0
Dave
Top achievements
Rank 1
answered on 01 Aug 2012, 03:10 PM
Yup - that did the trick. I am not sure why there'd need to be a short delay, but it works and I can move on. :)

Thanks!
Dave
Tags
Window
Asked by
Dave
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Dave
Top achievements
Rank 1
Share this question
or