Hi
We recently upgraded infragistics control library in to version 12.1 In one of our web applications, . We faced lot of issues and conflicts while doing that since there are major architectural changes. With lots of hard work, we could sort out most of the issues we had.
However we are currently facing a new problem with Web HTML Editor control. If you type more than one space and get the TextHTML of the control (from the code behind), there are "ᙦ" for the additional spaces. (if you type two spaces there will be one "ᙦ" sign). this happens in All the browsers.
I'm wondering whether this is a bug in the new control. I tried this with a sample application too and the result was same. Has anybody else have came across similar problem? Is there a workaround for this?
Any help is very much appreciated,
Wijitha
Hi Victor,
We found another issue in WebHtmlEditor. If you follow the previous posts of this thread you will get to know our initial problems and the solutions given. For you convenience i will give you a quick summary.
1) If you type more than one space and get the TextHTML of the control (from the code behind), there are "ᙦ" for the additional spaces. This issue was fixed by adding this in code behind (As you guys suggested)
string xhtml = this.WebHtmlEditor1.TextXhtml.Replace("ᙦ", " ");
2) My next question was, When we copy-paste content (that has multiple paragraphs) from MS word documents to the webHTMLEditor, "TexttHTML" property returns only the first paragraph of the content. To fix this i uses the this solution given by you guys,
function mySubmit() {" var editor = iged_getById('WebHtmlEditor1'); editor.setText(editor._cleanWord(editor.getText()));}
Apparently, It fixed the issue and we thought every thing is alright.
Our Latest Issue is, when we copy paste content from word documents, randomly it deletes spaces between words. After investigation i figured out it happening because of using _cleanWord() method. And also font size get smaller after calling that method. This happens in IE.
I will paste the content of my word document here, so that you can reproduce problem over there. (Normally you should be able to recreate this with any word doc)
-----
Here is an opportunity to purchase an excellent property in a desirable location. The presentation, size & price of this home should excite the first home buyers particularly & an astute investor, as this is a rare find in the current market. The home has separate lounge & family areas with a modern kitchen which includes gas cook top & dishwasher. The generously sized 3 bedrooms are well planned to enjoy living. All year round comfort is assured by the inclusions of ducted gas heating & a reverse-cycle air conditioning unit. This home has a spacious backyard for all kinds of entertainment with family & friends.
Set on 475m² block of land, you will find this beautifully home featuring 3 bedrooms, spacious living, dining, family areas & a single garage. The spacious family area leads to a backyard to spend quality time with family & friends. This home has it all for a fresh start to enjoy living on a hillside location. The home is close to all amenities in a great neighbourhood & presents an opportunity to enjoy an ideal lifestyle which should not be missed.
Property features & particulars:
* 3 bedrooms
* Separate living & family areas
* Spacious kitchen with gas cook-top & dishwasher
* Reverse cycle air conditioning unit
* Ducted gas heating throughout
* 2 way bathroom
* Separate toilet
* Single lock-up garage
* Easy care gardens
* A short walk to local shops, school & park
* Located within minutes from Gungahlin Town Centre
Quick fix is really appreciated as this issue is in the live environment.
Thanks,
P.S. we are using, ASP.Net 4.0 and Infragistics v12.1
HI Nikolay,
We could fix the issues we had using the workarounds given by you guys. Really appreciate the quick and accurate responses. Thanks for that.
At the moment, we dont have any other impediments. If any, we will get back to you.
Hello Wijitha,
If you have any further questions regarding the matter, please feel free to contact us.
Hi Wijitha,
That is possible. Problem is that when a text copied from Word is pasted into WebHtmlEditor (DIV in design mode), then IE browser may insert various obscure objects and attributes. To get around that feature of IE, the WebHtmlEditor has a special option (toolbutton with "W" and tooltip Clean Word Formatting), which is designed to get around that. However, after "paste", the end user should press that button explicitly, because WebHtmlEditor is not aware about possible paste action (especially from Word). Also, maybe application needs exact content pasted from Word.
So, there are few ways to get around.
1. If application does postback by a submit button, then the OnClientClick can be processed with following implementation:
<script type="text/javascript"> function mySubmit() {" var editor = iged_getById('WebHtmlEditor1'); editor.setText(editor._cleanWord(editor.getText())); } </script><asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="mySubmit()" />
2. Application may process ClientSideEvents.AfterAction (with check for "Paste") and attach keyDown event to editing element (with catching Ctrl+V) and use same _cleanWord method. I can provide implementation for that, but it will take few dozen lines of javascript codes.
3. Try to clean-up text on server. In current functionality of IE+Word, the main reason for failure is presence of objects like "<?xml:namespace ..." in the middle of text, so application may check for that Word-junk and remove it. Below is example.Note: It is possible that some other IE+Word tags/strings can lead to problems. To find them, an application may analyze content of WebHtmlEditor.Text.
string fixedText = null;string text = this.WebHtmlEditor1.Text;int wordStart = text.IndexOf("<?xml:namespace");int wordEnd = (wordStart >= 0) ? text.IndexOf("/>", wordStart) : -1;if (wordEnd > 0){ fixedText = text.Remove(wordStart, wordEnd - wordStart + 2); this.WebHtmlEditor1.Text = fixedText;}string xhtml = this.WebHtmlEditor1.TextXhtml;//if (fixedText != null) this.WebHtmlEditor1.Text = text;
Hi Viktor,
Thanks for your solution. It exactly solved the problem. But looking forward for a proper fix in the service releases.
I have one more problem that needed your attention. When we copy-paste content (that has multiple paragraphs) from MS word documents to the webHTMLEditor, "TexttHTML" property returns only the first paragraph of the content. So we cant save the whole content, just the first paragraph. This happens only in IE. This issues is not there in the other browsers (Chrome, FF, Safari).