Skip to main content
Participant
April 1, 2011
Question

Bug importing html text into RichEditableText

  • April 1, 2011
  • 1 reply
  • 833 views

Hi,

I've come across a bizarre bug when trying to use the TextConverter to import html text into a RichEditableText.

richText.textFlow = TextConverter.importToFlow(htmlText, TextConverter.TEXT_FIELD_HTML_FORMAT);

The problem happens when I set the text a second time with different html text.  Some words from the first string get left behind.

It put up an example illustrating this problem on my server (including view source code):

http://keg.cs.uvic.ca/flexdevtips/flex4/htmltextbug/HtmlTextBug.html

To see the bug, click the "Change Text" button, and the RichEditableText will get partially updated. 

I also tested this in Burrito and it still has the same problem.

Has anyone else seen this problem?  Should I file a bug on it?

Thanks,

Chris

This topic has been closed for replies.

1 reply

April 1, 2011

Please file a bug.

I expect you'll be able to work around the problem by adding this line after setting richText.textFlow:

richText.validateNow();

Participant
April 1, 2011

Thanks for your quick reply.


I've posted a bug here.

I tried your suggestion of doing this:

richText.validateNow();

And that did solve the problem (the text was properly updated), but it also introduced a new problem that the text no longer wrapped.

So instead I tried this:

richText.invalidateDisplayList();

And that seems to work sometimes, but not always.