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

RadEditor lost focus after Autosave

2 Answers 231 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Aytaç Utku TOPAL
Top achievements
Rank 2
Aytaç Utku TOPAL asked on 01 Jul 2009, 11:56 AM
Hello,

I am using RadEditor and arrange it to save automatically. I just copied Auto save demo example to my project. Actually, it works correctly. But Rad editor lost focus after autosave which is really annoying. Do you have any idea about  why I am experiencing such a scenario. I would appreciate it a lot, if you could help me to overcome it.

Thanks in Advance
Kind Regards
AytaƧ Utku TOPAL



Additional Informations:
  • I am using RadEditor 2009 Q1 version 2009.1.402.20

here are my timer and editor

 <asp:UpdatePanel ID="Deneme" runat="server" UpdateMode="Conditional">  
        <Triggers> 
            <asp:AsyncPostBackTrigger ControlID="TimerAutoSave" EventName="Tick" /> 
        </Triggers> 
        <ContentTemplate> 
            <telerik:RadEditor runat="server" ID="DocEditor" Height="550" Width="100%" OnClientLoad="OnClientLoad">  
              
            </telerik:RadEditor> 
            <asp:RequiredFieldValidator ID="EditorValidator" runat="server" ControlToValidate="DocEditor" 
                SetFocusOnError="true" Display="Static">  
            </asp:RequiredFieldValidator> 
            <asp:HiddenField ID="hdnUserID" runat="server" Value="" /> 
            <asp:HiddenField ID="hdnLanguageCode" runat="server" Value="" /> 
            <asp:HiddenField ID="hdnTempDocID" runat="server" Value="" /> 
            <asp:HiddenField ID="hdnServerName" runat="server" Value="" /> 
            <asp:HiddenField ID="hdnServerPort" runat="server" Value="" /> 
            <asp:HiddenField ID="hdnVirtualDirectoryName" runat="server" Value="" /> 
            <asp:HiddenField ID="hdnPostASPX" runat="server" Value="" /> 
        </ContentTemplate> 
    </asp:UpdatePanel> 
    <asp:Timer ID="TimerAutoSave" runat="server" Interval="120000">  
    </asp:Timer> 

Here are OnclientLoad function and timer related stuffs (It is almost identical with example given. It just doesn't update UI

   <script type="text/javascript">  
        function OnClientLoad(sender, args)  
        {  
            var timer = $find("<%=TimerAutoSave.ClientID %>");  
 
            startCounter();  
 
         sender.add_spellCheckLoaded(function()  
            {  
                var spell = sender.get_ajaxSpellCheck();  
 
                spell.add_spellCheckStart(function(sender, args)  
                {  
                    timer._stopTimer();  
 
                    //Stop counter  
                    stopCounter();  
                });  
 
                spell.add_spellCheckEnd(function(sender, args)  
                {  
                    //Restart the timer;   
                    timer._startTimer();  
 
                    //Restart counter  
                    startCounter();  
                });  
            }  
            );  
        }  
 
 
        var initialSeconds = 120;  
        var currentSeconds = initialSeconds;  
        var interval = null;  
        function startCounter()  
        {  
            if (!interval)  
            {  
                currentSeconds = initialSeconds;  
                interval = window.setInterval(function()  
                {  
                    if (currentSeconds > 0)  
                    {  
                        currentSeconds--;  
                    }  
                    else 
                    {  
                        currentSeconds = initialSeconds;  
                    }  
 
                }, 1000);  
            }  
        }  
        function stopCounter()  
        {  
            if (interval) window.clearInterval(interval);  
            interval = null;  
        }  
    </script> 

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 03 Jul 2009, 12:05 PM
Hello AytaƧ,

For this example to work correctly, the RadEditor control should not be in the update panel - just like it is shown in the demo. For convenience I reworked your code and attached it to this thread - I hope it helps.


Regards,
Georgi Tunev
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.
0
Chris Griffin
Top achievements
Rank 1
answered on 20 Dec 2010, 10:01 PM
I had the same problem and it turns out it is Compatibility mode in IE.  Tell your user base to turn off compatibility mode.
Tags
Editor
Asked by
Aytaç Utku TOPAL
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
Chris Griffin
Top achievements
Rank 1
Share this question
or