Repeating table + Rich text box + IE = SLOW - InfoPath Dev Sign in | Join | Help in Browser Forms InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Browser Forms » Repeating table + Rich text box + IE = SLOW Repeating table + Rich text box + IE = SLOW Last post 11-13-2009 11:52 AM by pweissbrod. 13 replies. Page 1 of 1 (14 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 03-10-2009 08:05 AM pweissbrod Joined on 07-07-2008 Posts 20 Repeating table + Rich text box + IE = SLOW Reply Contact Hi I am at a loss for alternatives here and I was hoping that maybe reaching out to the gurus of InfoPath could help bail me out. I have developed a form designed for viewing on a web page. I have demonstrated the functionality to my clients using the fat client and they are very pleased. I used the compatibility design checker to make sure my form would work correctly on the web server. I deploy the form to the site and guess what happens? It is slow slow it is almost perfectly unusable! After a late night (morning) of tinkering with the form, I have found the culprit: I have a rich text box control inside of a repeating table, and this slows IE down to a crawl (and subsequently my entire client-side computer) I have read about the memory leaks involved with IE7 and this control. I have read the FORM.js and BFORM.js and CORE.js in search of a way to modify the RTE_ functions, but this seems dangerous. I have replaced the form fields with simple multi-line text boxes, but when you print the form, the full contents are hidden, and that is not acceptable. All I need is a simple text box that expands vertically to show all of its contents, so nothing is hidden in print view. I dont need the fancy formatting features involved with the rich text editor. Does anyone know of a simple way to make a web-enabled multi-line textbox that will expand to show all of its contents so the form is actually printable? Filed under: web based form, rich text 03-10-2009 09:22 AM In reply to Alec Pojidaev Joined on 12-16-2008 Posts 163 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact May be using just 1 rich text box where you will keep concatenated texts of simple textboxes would be a solution? You could place your repeating section and this rich text box on different views to avoid printing same content two times. http://alecpojidaev.wordpress.com/ 03-10-2009 09:32 AM In reply to pweissbrod Joined on 07-07-2008 Posts 20 Re: Repeating table + Rich text box + IE = SLOW 3-10-2009 12-27-13 PM.gif Mark as Not AnswerMark as Answer... Reply Contact Thanks for the fast response! I just attached a screenshot of the form I am dealing with for better context. As you can see, the text boxes are not the only thing in the repeating table, there are rating radio buttons and drop-down lists as well. I'm not quite sure I am seeing your alternative vision here. Do you think a single rich text box could represent this table properly? 03-10-2009 09:39 AM In reply to Alec Pojidaev Joined on 12-16-2008 Posts 163 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact pweissbrod: Do you think a single rich text box could represent this table properly? I see no problem to represent all text values of all your controls in that single rich text box with no code. In case if you are looking for a way to preserve formatting (table like view) then probably you have to do it programmaticly. http://alecpojidaev.wordpress.com/ 03-11-2009 07:17 AM In reply to pweissbrod Joined on 07-07-2008 Posts 20 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact Alec Thanks for the advice, but I still do not see your vision. If I have a single text box then how am I supposed to tie substrings of that single textbox to the corresponding rows with dropw-downs and radio buttons in a foolproof manner? I wish I could understand your plan. Either way, you can imagine the look on my client's face if I tell them that we need to re-design the entire form because the $60,000 license they purchased for InfoPath forms services will not support spell checking and printability as advertised because the included javascript causes memory leaks in Microsoft's recommended browser. They would be furious. Is a rich text box in a repeating table asking too much? All it takes is 15 rows to crash my machine. Either Microsoft needs to publicize this limitation in their docs to warn us ahead of time or fix it with a patch. It sould be easy to fix considering that JQuery has many different solutions that scale better than the one in InfoPath. I fixed the issue by modifying the Core.js file in /templates/inc/ to change the behavior of the multi-line textboxes so they expand to fit the contents, it was six lines of javascript code. Then I changed all of my rich text boxes to multi-line textboxes. I realize that modifying Core.js is not recommended, but I was cornered into a situation where I had little choice. 03-19-2009 05:32 AM In reply to Garry Joined on 02-23-2009 Posts 7 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact Hi there I have the same problem ran a great demo to my department in infopath but it was dog slow in a browser, what code did you change in the Core.js file to get the text boxes to show multiline in a browser? I’m no coder but I’ll change anything to get this working, if you can help I’ll be very very grateful. Thanks Garry 03-19-2009 05:51 AM In reply to pweissbrod Joined on 07-07-2008 Posts 20 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact Yeah its pretty horrible isnt it? Maybe its my fault for having the wrong expectations, but I've found InfoPath to prove useful with only the simplest of forms. Anything with larger content or non-trivial interaction should be done with an ASPX page. The biggest problem is the rich text editor. For some reason that defies my understanding, Microsoft wrote their rich text editor using an activeX control instead of javascript. This means the control only works in IE and when you try to use it in chrome, firefox,safari etc, you get loud errors every time you click on it. Since thats not very professional, I've been in the process of replacing the rich text editor with TinyMCE. for example: http://www.notesfor.net/post/Enhance-SharePoint-rich-text-field.aspx ANYWAYS, the Core.js adjustment is a last resort option. Editing this file is not a recommended thing, and may surely get washed away with any given patch or upgrade, so this example is for educational purposes only: The new stuff I added is wrapped in "***" just in case your line numbers dont match with mine they should be close by. Line 9333: (adds a new event handler to the multiline textbox for keyUp) ErrorVisualization.ShowAsterisk(objControl);}}***if(objControl.onkeyup){objControl.fireEvent("onkeyup");}***} 9405: (adds new event handlers to multiline txtbox for cut/paste/scroll) {***if(UserAgentInfo.strBrowser==1){arrHtmlToInsertBuilder.push(" style=\"overflow:hidden;\" oncut=\"TextBox_OnCutOrPaste();\" onpaste=\"TextBox_OnCutOrPaste();\" onkeydown=\"TextBox_Resize(this);\" onscroll=\"TextBox_OnScroll();\" onkeyup=\"TextBox_Resize(this);\" ");}***arrHtmlToInsertBuilder.push(arrTemplate[1]); 9414: (defines the event handler for resizing the txtbox) *** function TextBox_OnScroll(){var e=window.event.srcElement;var tr=e.createTextRange();if(tr.offsetTop>0)tr.scrollIntoView();TextBox_Resize(e);}function TextBox_OnCutOrPaste(){var e=window.event.srcElement;window.setTimeout(function(){TextBox_Resize(e);}, 25)}function TextBox_Resize(obj){var minHeight=obj.getAttribute("minHeight");if(minHeight==null){minHeight=obj.offsetHeight;obj.setAttribute("minHeight",minHeight);}if(obj.scrollHeight!=obj.clientHeight){var height=obj.offsetHeight+obj.scrollHeight-obj.clientHeight;obj.style.height =(height<minHeight)?minHeight:height;}};***TextBox.OnFocus = function (objControl, objEvent) good luck and sorry about the confusing formatting in this post the forum doesnt allow for a good code layout it just clumps all the text together into a single paragraph 03-19-2009 06:46 AM In reply to Garry Joined on 02-23-2009 Posts 7 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact Thanks for the quick answer will try this out on our test server. Thanks again Garry 11-06-2009 10:23 AM In reply to Selarim Joined on 10-30-2009 Brazil Posts 48 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact pweissbrod:Yeah its pretty horrible isnt it? Maybe its my fault for having the wrong expectations, but I've found InfoPath to prove useful with only the simplest of forms. Anything with larger content or non-trivial interaction should be done with an ASPX page. The biggest problem is the rich text editor. For some reason that defies my understanding, Microsoft wrote their rich text editor using an activeX control instead of javascript. This means the control only works in IE and when you try to use it in chrome, firefox,safari etc, you get loud errors every time you click on it. Since thats not very professional, I've been in the process of replacing the rich text editor with TinyMCE. for example: http://www.notesfor.net/post/Enhance-SharePoint-rich-text-field.aspx ANYWAYS, the Core.js adjustment is a last resort option. Editing this file is not a recommended thing, and may surely get washed away with any given patch or upgrade, so this example is for educational purposes only: The new stuff I added is wrapped in "***" just in case your line numbers dont match with mine they should be close by. Line 9333: (adds a new event handler to the multiline textbox for keyUp) ErrorVisualization.ShowAsterisk(objControl);}}***if(objControl.onkeyup){objControl.fireEvent("onkeyup");}***} 9405: (adds new event handlers to multiline txtbox for cut/paste/scroll) {***if(UserAgentInfo.strBrowser==1){arrHtmlToInsertBuilder.push(" style=\"overflow:hidden;\" oncut=\"TextBox_OnCutOrPaste();\" onpaste=\"TextBox_OnCutOrPaste();\" onkeydown=\"TextBox_Resize(this);\" onscroll=\"TextBox_OnScroll();\" onkeyup=\"TextBox_Resize(this);\" ");}***arrHtmlToInsertBuilder.push(arrTemplate[1]); 9414: (defines the event handler for resizing the txtbox) *** function TextBox_OnScroll(){var e=window.event.srcElement;var tr=e.createTextRange();if(tr.offsetTop>0)tr.scrollIntoView();TextBox_Resize(e);}function TextBox_OnCutOrPaste(){var e=window.event.srcElement;window.setTimeout(function(){TextBox_Resize(e);}, 25)}function TextBox_Resize(obj){var minHeight=obj.getAttribute("minHeight");if(minHeight==null){minHeight=obj.offsetHeight;obj.setAttribute("minHeight",minHeight);}if(obj.scrollHeight!=obj.clientHeight){var height=obj.offsetHeight+obj.scrollHeight-obj.clientHeight;obj.style.height =(height<minHeight)?minHeight:height;}};***TextBox.OnFocus = function (objControl, objEvent) good luck and sorry about the confusing formatting in this post the forum doesnt allow for a good code layout it just clumps all the text together into a single paragraph You said it should be close to the line 9333...But could you tell me the exact line (for example, "between 'if (TextBox.IsMultiLine(objSnippetElement))' and '{strFormattedValue = TextBox_NormalizeCRLF(strFormattedValue);}'")?Thank you very much... 11-06-2009 10:41 AM In reply to pweissbrod Joined on 07-07-2008 Posts 20 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact OK you are officially the 5th person to reach out to me on this bug. I simply dont have enough time to help you with the code. Your core.js file may vary depending on the service pack. Make sure you back up your core.js before doing this. Download BeyondCompare or an equivalent diff tool, and compare your core.js with mine. http://www.reallifedata.com/core.js **disclaimer: Microsoft, please dont sue me, I am only trying to assist one of the users who fell into the same problem as I did with this awful program 11-06-2009 11:09 AM In reply to Selarim Joined on 10-30-2009 Brazil Posts 48 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact pweissbrod:OK you are officially the 5th person to reach out to me on this bug. I simply dont have enough time to help you with the code. Your core.js file may vary depending on the service pack. Make sure you back up your core.js before doing this. Download BeyondCompare or an equivalent diff tool, and compare your core.js with mine. http://www.reallifedata.com/core.js **disclaimer: Microsoft, please dont sue me, I am only trying to assist one of the users who fell into the same problem as I did with this awful program pweissbrod, I really don't want to bother you, but I'm here again because the costumer is about to kill me...I took a look in your file...But the line 9332 = "{if (objOldDateTime.strTZOffset == "Z")" and 9333 = "{objNewDateTime.strTZOffset = "Z";}"...I don't think this is the line you were talking about...Am I right? I know you don't have much time, but I'm desperate...I need to solve this today or I'm not sure if I'll be alive tomorrow... Thank you very much again , pweissbrod.. 11-06-2009 11:21 AM In reply to pweissbrod Joined on 07-07-2008 Posts 20 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact This is code I modified in January, and I dont have the time to open it up and troubleshoot it. You need to download beyondcompare like I told you and compare the two JS files. the differences will be highlighted, and you are going to merge the differences (somewhere within the lines 9200-9500) from my file into yours. There is no easier way to do it because my service pack is not guaranteed to match yours. You need to read the code and understand where the blocks begin and end. Your customer should not be angry at you for the shortcomings of infopath, but I can appreciate how this technology frustrates people and makes consultants look bad. Nonetheless if you want to sub-contract the work to me, then you can contact my company and then I would be happy to implement it for you. 11-09-2009 03:58 AM In reply to Selarim Joined on 10-30-2009 Brazil Posts 48 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact pweissbrod:This is code I modified in January, and I dont have the time to open it up and troubleshoot it. You need to download beyondcompare like I told you and compare the two JS files. the differences will be highlighted, and you are going to merge the differences (somewhere within the lines 9200-9500) from my file into yours. There is no easier way to do it because my service pack is not guaranteed to match yours. You need to read the code and understand where the blocks begin and end. Your customer should not be angry at you for the shortcomings of infopath, but I can appreciate how this technology frustrates people and makes consultants look bad. Nonetheless if you want to sub-contract the work to me, then you can contact my company and then I would be happy to implement it for you. ok, I'm still alive, but I don't have much time...My company is from Brazil, how do we contact yours? Could you send me your e-mail address? Thanks... 11-13-2009 11:52 AM In reply to pweissbrod Joined on 07-07-2008 Posts 20 Re: Repeating table + Rich text box + IE = SLOW Mark as Not AnswerMark as Answer... Reply Contact Sorry for not getting back to you but it seems that the forum did not notify me that you made a new post. If you still need my help, email me with pweissbrod at greenpages.com and we can work out a solution for you Page 1 of 1 (14 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
May be using just 1 rich text box where you will keep concatenated texts of simple textboxes would be a solution? You could place your repeating section and this rich text box on different views to avoid printing same content two times.
pweissbrod: Do you think a single rich text box could represent this table properly?
I see no problem to represent all text values of all your controls in that single rich text box with no code. In case if you are looking for a way to preserve formatting (table like view) then probably you have to do it programmaticly.
Hi there I have the same problem ran a great demo to my department in infopath but it was dog slow in a browser, what code did you change in the Core.js file to get the text boxes to show multiline in a browser? I’m no coder but I’ll change anything to get this working, if you can help I’ll be very very grateful.
Thanks
Garry
Thanks for the quick answer will try this out on our test server.
Thanks again
pweissbrod:Yeah its pretty horrible isnt it? Maybe its my fault for having the wrong expectations, but I've found InfoPath to prove useful with only the simplest of forms. Anything with larger content or non-trivial interaction should be done with an ASPX page. The biggest problem is the rich text editor. For some reason that defies my understanding, Microsoft wrote their rich text editor using an activeX control instead of javascript. This means the control only works in IE and when you try to use it in chrome, firefox,safari etc, you get loud errors every time you click on it. Since thats not very professional, I've been in the process of replacing the rich text editor with TinyMCE. for example: http://www.notesfor.net/post/Enhance-SharePoint-rich-text-field.aspx ANYWAYS, the Core.js adjustment is a last resort option. Editing this file is not a recommended thing, and may surely get washed away with any given patch or upgrade, so this example is for educational purposes only: The new stuff I added is wrapped in "***" just in case your line numbers dont match with mine they should be close by. Line 9333: (adds a new event handler to the multiline textbox for keyUp) ErrorVisualization.ShowAsterisk(objControl);}}***if(objControl.onkeyup){objControl.fireEvent("onkeyup");}***} 9405: (adds new event handlers to multiline txtbox for cut/paste/scroll) {***if(UserAgentInfo.strBrowser==1){arrHtmlToInsertBuilder.push(" style=\"overflow:hidden;\" oncut=\"TextBox_OnCutOrPaste();\" onpaste=\"TextBox_OnCutOrPaste();\" onkeydown=\"TextBox_Resize(this);\" onscroll=\"TextBox_OnScroll();\" onkeyup=\"TextBox_Resize(this);\" ");}***arrHtmlToInsertBuilder.push(arrTemplate[1]); 9414: (defines the event handler for resizing the txtbox) *** function TextBox_OnScroll(){var e=window.event.srcElement;var tr=e.createTextRange();if(tr.offsetTop>0)tr.scrollIntoView();TextBox_Resize(e);}function TextBox_OnCutOrPaste(){var e=window.event.srcElement;window.setTimeout(function(){TextBox_Resize(e);}, 25)}function TextBox_Resize(obj){var minHeight=obj.getAttribute("minHeight");if(minHeight==null){minHeight=obj.offsetHeight;obj.setAttribute("minHeight",minHeight);}if(obj.scrollHeight!=obj.clientHeight){var height=obj.offsetHeight+obj.scrollHeight-obj.clientHeight;obj.style.height =(height<minHeight)?minHeight:height;}};***TextBox.OnFocus = function (objControl, objEvent) good luck and sorry about the confusing formatting in this post the forum doesnt allow for a good code layout it just clumps all the text together into a single paragraph
You said it should be close to the line 9333...But could you tell me the exact line (for example, "between 'if (TextBox.IsMultiLine(objSnippetElement))' and '{strFormattedValue = TextBox_NormalizeCRLF(strFormattedValue);}'")?
Thank you very much...
pweissbrod:OK you are officially the 5th person to reach out to me on this bug. I simply dont have enough time to help you with the code. Your core.js file may vary depending on the service pack. Make sure you back up your core.js before doing this. Download BeyondCompare or an equivalent diff tool, and compare your core.js with mine. http://www.reallifedata.com/core.js **disclaimer: Microsoft, please dont sue me, I am only trying to assist one of the users who fell into the same problem as I did with this awful program
pweissbrod, I really don't want to bother you, but I'm here again because the costumer is about to kill me...I took a look in your file...But the line 9332 = "{if (objOldDateTime.strTZOffset == "Z")" and 9333 = "{objNewDateTime.strTZOffset = "Z";}"...I don't think this is the line you were talking about...Am I right? I know you don't have much time, but I'm desperate...I need to solve this today or I'm not sure if I'll be alive tomorrow...
Thank you very much again , pweissbrod..
pweissbrod:This is code I modified in January, and I dont have the time to open it up and troubleshoot it. You need to download beyondcompare like I told you and compare the two JS files. the differences will be highlighted, and you are going to merge the differences (somewhere within the lines 9200-9500) from my file into yours. There is no easier way to do it because my service pack is not guaranteed to match yours. You need to read the code and understand where the blocks begin and end. Your customer should not be angry at you for the shortcomings of infopath, but I can appreciate how this technology frustrates people and makes consultants look bad. Nonetheless if you want to sub-contract the work to me, then you can contact my company and then I would be happy to implement it for you.
ok, I'm still alive, but I don't have much time...My company is from Brazil, how do we contact yours? Could you send me your e-mail address?
Thanks...