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

Access timer from radwindow

5 Answers 136 Views
Window
This is a migrated thread and some comments may be shown as answers.
Linda
Top achievements
Rank 1
Linda asked on 11 Oct 2010, 11:14 PM
Hi,

I have a radwindow that I am using to edit items in a radgrid (loaded using the javascript GetWindow() from the examples). This radgrid is in a usercontrol and is loaded dynamically in the main page. The main page controls (including this usercontrol) is then connected to a timer that refreshes the page every 60 seconds using ajax manager (timer is set as the main control and the user control is set as the updated control)
Problem is, when the refresh happens, the radwindow is cleared away and from then on will not load or display on the page.

I have tried various ways to get this working using one that I thought should work was putting in a javascript function to get the client ID in the main page and calling this function from the user control (which does return the timer control) and then setting the disabled property to false. Issue with this is, I get the control fine, set it to disabled but still the timer is ticking away and continues to refresh. 
I have been working on this issue for a couple of days now and would really appreciate a quick response. 

Many thanks!
Linda

5 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 12 Oct 2010, 07:17 AM
Hi Linda,

If I understand your scenario correctly, you have a JavaScript function on the main page that should control the timer and you call that function from within the content page (I assume you are using GetRadWindow().BrowserWindow.calledFunction()) and this is not working as expected. If this is so, what happens if you call the function on the main page directly - e.g. by clicking a button on the same page?

If this is not your case, please provide some more details about your setup and code samples that would allow us to get a better view over your scenario.

Kind regards,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Linda
Top achievements
Rank 1
answered on 12 Oct 2010, 09:20 AM
I have this timer in the main page.This timer controls refreshing of this main page. I have this ajax setting in the main page. this timer controls refreshes the content of this main page. The user control is loaded in the tab strip. the user control has a rad window in it to edit the form. The radwindow is opened using GetWindow() in javascript.
Problem is when the ontick event gets called and the radwindow is open, it disappears. I need to access the timer from the usercontrol and disable it in the openwindow/client activate javascript function. and in the client close re-enable the timer.
Thanks. 

 

 

<asp:Timer ID="hello" runat="server" OnTick="hello_Tick" Interval="20000" Enabled="true"
</asp:Timer
<telerik:AjaxSetting AjaxControlID="hello" >
<UpdatedControls
<telerik:AjaxUpdatedControl ControlID="tabstrip" /> 
</UpdatedControls
</telerik:AjaxSetting>
function OpenWindow(id, rowIndex) { 
var gridView = $find("<%= gridView.ClientID %>"); 
var rowControl = gridView.get_detailTables()[1].get_dataItems()[rowIndex].get_element(); 
gridView.get_detailTables()[1].selectItem(rowControl, 
true); 
window.radopen(
"EditForm.aspx?hello=" + id, "UserListDialog"); 
return false; 
}
  
0
Linda
Top achievements
Rank 1
answered on 12 Oct 2010, 03:55 PM
Do you understand the scenario?? Any suggestions as to how I can get this working?
0
Georgi Tunev
Telerik team
answered on 13 Oct 2010, 12:10 PM
Hello Linda,

So the user control (with the RadWindow in it) is on the same page where the timer is, right? If so, the easiest way to disable the timer is to use its client-side API and stop it when you show the RadWindow. After that, you could hook to the ClientClose event of the RadWindow object and to start the timer again when the RadWindow is closed.
Please check the attached sample. In it, the first button opens a RadWindow without affecting the timer - which is the scenario I assume you have. The second button uses the logic that I suggested above and the window remains open on the page.


All the best,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Linda
Top achievements
Rank 1
answered on 14 Oct 2010, 09:42 AM
Thanks for this. Worked like a charm.
Tags
Window
Asked by
Linda
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Linda
Top achievements
Rank 1
Share this question
or