1 Reply Latest reply on Sep 3, 2009 11:44 PM by Flex harUI

    richtextarea refresh function

    theBinki

      Hi, all.  More richTextArea questions.

       

      I have an issue where text is bound to the richTextArea.htmlText in my application.  The user runs a report and I do some formatting on it, then it is assigned to a variable that is bound to the richTextArea.htmlText property.  The text shows up and looks fine.  The user can then edit this text.  There is a second textarea that displays the 'preview', which also looks fine.

       

      One thing I noticed is that when the text is first displayed in the richTextArea, if you view the html, it is just what I first processed.  I use the HTML tags that the richTextArea documents supports.  Now, if the user hits the View PDF button, I dump the richTextArea.htmlText to a database, get the ID back, pass the ID via URL variable to a new browser window using URLRequest.  The ID is used to do a query, getting the report and displaying it using cfdocument.  This all works fine (with some replacement of font sizes, see past posts).  Now, in this version, the spacing between lines of text in the PDF is fairly wide.

       

      But if you type just one thing in the richTextArea, like a space, it forces the richTextArea to parse and format the text.  This adds <textformat>ing to everything.  Now when you go back to the preview and view the PDF version, everything gets much tighter.  Not a problem because it all still looks ok, but there is a distinct change.  This 'event' is like a change event.  But it only happens if I directly interact in the richTextArea, like hitting bold or something like that.  But if I programmaticly select or deselect the bold button, the 'refresh' event does not fire.

       

      Is there a way to programmitically make the richTextArea refresh or reparse and format the text?

       

      I know this is verbose, my apologies.  I hope it makes some sort of sense.