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

RadWindow - Touch AJAX Timer in Parent Window

2 Answers 43 Views
Window
This is a migrated thread and some comments may be shown as answers.
ataxia1
Top achievements
Rank 1
ataxia1 asked on 06 Aug 2008, 02:24 AM
Trying to restart an AJAX timer running in the parent window whenever a RadWindow is closed with JavaScript.

Here's a snippet of the js code on the window page:

var oWindow = GetRadWindow();
var timer = find$("ctl00_cphContent_RefreshTimer1");
timer._startTimer();
oWindow.Close();


The window close works fine.  The find$ code works on a standard page, but I can't locate the parent page's timer from the windowed page's JavaScript.  Any idea what I can use to reference the timer control from inside the window?  I tried all the basics I could think of (e.g. document.GetElementById)

Assuming I either need to drill back using a .parent or drill down from a window. but wasn't sure where to start.

Thanks

- Brad

2 Answers, 1 is accepted

Sort by
0
Accepted
Shaun Peet
Top achievements
Rank 2
answered on 06 Aug 2008, 03:59 AM
Hello,

What you'll want to do is have the client-side function that restarts the timer on the parent page, and then call that function from the window.  So:

On the parent page:

function start_the_timer() {
  var timer = $find("<%= RefreshTimer1.ClientID  %>");
  timer._startTimer();
}

On the window page:

var oWindow = GetRadWindow();
oWindow.BrowserWindow.start_the_timer();
oWindow.close();

Hope that helps,

Shaun.
0
ataxia1
Top achievements
Rank 1
answered on 06 Aug 2008, 01:19 PM
Excellent.  Thanks for the help.
Tags
Window
Asked by
ataxia1
Top achievements
Rank 1
Answers by
Shaun Peet
Top achievements
Rank 2
ataxia1
Top achievements
Rank 1
Share this question
or