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 Wijitha,
Thank you for a report.
That case was missed while internal testing and it was not reported. It has been fixed and update will be available within service releases.
For now you may fix that by following:
string xhtml = this.WebHtmlEditor1.TextXhtml.Replace("ᙦ", " ");
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).
Thanks,
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 Victor,
It fixed the issue. Thanks for the solution
cheers,
Thanks for second post. Initially I did not reproduce that, because "bold" texts were ok. Though, after I reviewed all other content, I noticed that some words were merged. That happened, because pasting from Word may generate explicit new lines (\n\t) for "soft" returns, and WebHtmlEditor while converting to Xhtml removed all \n characters.
That issue has beed fixed and update will be available within service releases.
For now in current version, you may get around by following codes:
string old = this.WebHtmlEditor1.Text;this.WebHtmlEditor1.Text = old.Replace("\n", " ");string xhtml = this.WebHtmlEditor1.TextXhtml;// optional:this.WebHtmlEditor1.Text = old;
We got the latest release (NetAdvantage_ASPNET_20122.2031_SR) and included it in our web application. It solved the two issues we had initially.
01) Saving garbage characters when there are multiple spaces.
02) Paragraphs loosing issue when there are multiple paragraphs which were previously fixed by calling _cleanWord() manually.
So that, now we could remove the hacks we put to fix those issues earlier.
But still there is an issue. When we copy paste content from MS Word documents, space between words get deleted randomly. So that some words are concatenating and difficult to read.
EX:
Copy pasted test: (if you want to recreate this issue, please copy this text to a word document and from there copy-paste to a web html editor control)
Given Sri Lanka's history in Hobart, a target of 393 in the first Test was not out of reach in the four sessions available to them. In 2007, Kumar Sangakkara's 192 had propelled the visitors to 410, but in 2012, chances of an upset win evaporated soon after Sri Lanka's openers took guard on the fourth day. A fissured pitch spat up steepling brutes and ankle-high shooters with equal abandon making even survival a daunting prospect.
"If we just look at the last day, I am unbelievably proud of the performance the boys put in," Graham Ford, the Sri Lanka coach, said. "That surface really became a minefield. It was very difficult. Australia got the ball to reverse swing considerably. If you look at probably just about every dismissal, it took a real cracker of a delivery to get the batsman out. As a coach you can't really ask for much more from your troops the way the boys battled out there.
Text Returned by TextXhtml property of webHtmlEditor:
Given Sri Lanka'shistory in Hobart, a target of 393 in the first Test was not out of reach inthe four sessions available to them. In 2007, Kumar Sangakkara's 192hadpropelled the visitors to 410, but in 2012, chances of an upset win evaporatedsoon after Sri Lanka's openers took guard on the fourth day. A fissured pitchspat up steepling brutes and ankle-high shooters with equal abandon making evensurvival a daunting prospect.
"If we just look at the last day, I am unbelievably proudof the performance the boys put in," Graham Ford, the Sri Lanka coach,said. "That surface really became a minefield. It was very difficult.Australia got the ball to reverse swing considerably. If you look at probablyjust about every dismissal, it took a real cracker of a delivery to get thebatsmanout. As a coach you can't really ask for much more from your troops theway the boys battled out there.
I have bold some words where it has removed spaces between words. I think this issue had not been fixed the service pack release.
Thanks
Given Sri Lanka'shistory in Hobart, a target of 393 in the first Test was not out of reach inthe four sessions available to them. In 2007, Kumar Sangakkara's 192 hadpropelled the visitors to 410, but in 2012, chances of an upset win evaporatedsoon after Sri Lanka's openers took guard on the fourth day. A fissured pitchspat up steepling brutes and ankle-high shooters with equal abandon making evensurvival a daunting prospect.
"If we just look at the last day, I am unbelievably proudof the performance the boys put in," Graham Ford, the Sri Lanka coach,said. "That surface really became a minefield. It was very difficult.Australia got the ball to reverse swing considerably. If you look at probablyjust about every dismissal, it took a real cracker of a delivery to get thebatsman out. As a coach you can't really ask for much more from your troops theway the boys battled out there.
Hi Vijitha,
The issue with spaces on server was fixed in July. The "cleaning" format after pasting (from Word or any other source) was modified 2 months ago. Now "cleaning" should happen automatically while pasting and no need for end user to press "Clean Word" button. Also replacement logic while "cleaning" was changed too. Some tags which were removed before (like SPAN, indent, etc) now will stay, but some others which define MS-word css classes and styles will be removed.
I suggest you to get latest service release version of NetAdvantage.