A quick follow-up (while we still maintain that your scenario is complex and to address the problems you are having with completing your advanced custom scenario it will be best to send us a fully working project that demonstrates the issues in a support ticket):
1) Focus event is called before each paste operation to ensure that the editor does indeed have the focus. Likely, if the editor did have focus already, the onfocus event will still be raised. This is not a bug. There is nothing technically wrong with making sure it is the editor that has the focus before pasting content into it. One should not forget that HTML elements do not offer a isFocused() or hasFocus() method which could let the editor *know* whether ti currently has focus - and relying on the onblur method to *inform* about focus lost is simply not sufficient in all scenarios.
2) In your scenario it seems that you are "replacing" the RadEditor as a result from the AJAX request. But also, in the same time you mention that you have added a RadToolTop to the editor on the client-side using client code. If this is indeed your scenario, please note that you need to make sure your tooltip is detached after the AJAX operation is complete. OR, alternatively, you might consider NOT updating the editor/editor's parent panel as a result of the AJAX request. If you need to simply set new content into the editor as a result of the AJAX request, you can do so by using client code. If you simply need to get the editor content on the server, you do not need to include the editor/editor panel as a control to be updated by the RadAjaxManager at all
. The editor value will be sent anyway in each POST request, regardless of whether it will be used on the server or not. This is how MS AJAX works. For more info, please consider the following demo:
3) The description of the problems suggests that it very likely comes from adding custom code to the onblur method. Please test whether the error disappears after removing your code. If it indeed does, then for suggestions how to eliminate the error we will need to examine the actual code that you use. It could be again that it is a result of mixing AJAX updates with client-side event handlers that are attached, but never detached.
4) If you refer to the server side OnTextChanged event, this event is raised in many more cases than actually needed "on purpose". There are three reasons for this - 1) IFRAMEs (such as the editor's content area) do not havea onchange event as textareas
do. This is one major problem when determining whether content actually changed. 2) HTML
is not text.
can be easily compared - HTML cannot. Factors such as element attribute sequence, CSS settings, whitespace - can afect the editor "decision making process" and have it raise the "text changed" event even if the content was not actually changed. And the most important reason #3) is that browsers, most importantly IE make a great deal of changes to the content automatically when it is loaded in the browser. For example, IE would covnert all tags to upper case (which is not XHTML compliant). Many browser commands also produce non-XHTML compliant content - which the editor then needs to fix. It is not by chance that the editor features 20+ content filters that get executed automatically by default to correct for browser deficiencies and produce well-formed, valid XHTML. For more information please examine the following demo:
Hence, what happens in reality is that content from the server gets loaded in the browser - browser screws it up - then the editor attempts to *fix" it - and as a result, it is often the case that, while the end HTML produces the same visual results, it is in fact not 100% identical to the original.
I hope this information will be helpful to you in resolving the issues you have encountered.
the Telerik team