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

Resetting Timer From Radwindow

1 Answer 152 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Rich
Top achievements
Rank 1
Rich asked on 27 Feb 2009, 04:19 PM
Hi All

I am having problems getting a rad window to reset a timer on the parent page. Below is the code I have in place.

-- The below code is on the Parent Page

    <radA:RadAjaxPanel ID="RadAjaxPanel" runat="server" Height="1px" Width="1px">     
          <radA:RadAjaxTimer ID="radTimer1" runat="server" AutoStart="False" />    
          <radA:RadAjaxTimer ID="radTimer2" runat="server" AutoStart="False" />                      
    </radA:RadAjaxPanel>    
      
    <radW:RadWindowManager ID="TimeoutWarningPopup"   
                           runat="server"   
                           VisibleOnPageLoad="false"   
                           Width="320" 
                           Behavior="close,move"   
                           ReloadOnShow="false" 
                           skin="Web20">                         
    </radW:RadWindowManager>   


        function StartTimer()  
        {  
            <%=radTimer2.ClientID %>.Stop();  
            <%=radTimer2.ClientID %>.Start();  
        } 

-- This code is on the Rad Window and is called by the OnClick() of a standard HTML button

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

            function CloseWindow()  
            {   
                var oWindow = GetRadWindow();  
                oWindow.BrowserWindow.StartTimer();                  
                oWindow.Close();  
            } 

This code is to create an application timeout / warning feature using code based on this post: http://www.telerik.com/community/forums/aspnet/window/automatic-logout-using-rad-window-and-rad-ajaxtimer.aspx

Basically, the radwindow is opened by the the radTimer1 (this piece works fine). When radTimer2 hits, the site is sent to a timout page. What I need to happen is for radTimer2 to be reset back to 0 if the user clicks OK on the popup window. I do not get any errors, however, the timer does not get reset and the site will always timeout.

I would also like to have both of the timers reset on key and mouse use. Below is code we have in place for the JavaScript timeout we currently have in production.

    window.focus();  
    window.captureEvents(Event.KEYPRESS);  
    window.captureEvents(Event.MOUSEDOWN);  
    window.onkeypress = resetTimer;  
    window.onmousedown = resetTimer; 

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 03 Mar 2009, 11:49 AM
Hello Rich,

To properly trace the issue at hand, it will be best if you open a formal support ticket, and send us a small working project, demonstrating your setup, along with the unwanted behavior.
We will review it locally, and advise you further.
Thank you for your cooperation.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
Rich
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or