Skip navigation
existnresist
Currently Being Moderated

textFlow (RichEditableText) not updating properly

Aug 8, 2010 8:22 AM

hi all,

 

i have a number of cases where trying to update texts, usually on RichEditableText objects generated in actionscript, does not show up or shows up in a weird way.

 

example 1:

RichEditableText component already declared in MXML. simplifying, when i use something like:

var myTextFlow:TextFlow = TextConverter.importToFlow(strToFormat, TextConverter.TEXT_FIELD_HTML_FORMAT);

questionText.textFlow = myTextFlow;  // questionText is a RichEditableText declared in MXML

 

sometimes it shows well but most times it is a mixture of 1-2 lines from the new text + 1-2 lines from the text which was there earlier. this is not due to wrong assignment into vars but maybe i need to initialize or refresh the component? is there a refresh function??

 

example 2:

i have 2 seperate bunches of RichEditableText components, created in actionscript with formatting and data for each (along with wrapping VGroups and HGroups).

the 2 are each associated to a different State and, as far as i know, should appear/disappear according to the current State.

however, if "bunch 1" appears and then i switch state to see "bunch 2" instead -- the window is empty - as if no text exists in the RichEditableTextobjects.

and also vice versa - if i first look at "bunch 2" it appears well, but when trying to switch State and see "bunch 1" instead -- the window again becomes empty of text (although it appeared well in the previous scenario going to "bunch 1" first).

am i missing a refresh of some sort???

 

 

thanks,

r. 

 
Replies
  • Currently Being Moderated
    Aug 9, 2010 12:22 AM   in reply to existnresist

    I think that's a bug that's being fixed as we speak.  You could try setting

    text="" and calling validateNow before setting a new textflow.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 9, 2010 1:48 PM   in reply to existnresist

    I did not spend time to figure out a workaround.  IIRC, the issue is that

    the method remeasureText() in RichEditableText.as needs to return false, but

    doesn't.  There are various ways you might be able to get it to return

    false.  Maybe if you step through it you can figure out which one will be

    easiest to hack.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2010 9:13 AM   in reply to existnresist

    I encountered exactly the same issue as the OP. Tried a lot of things like: Settting the text property to "", or setting textFlow to null, etc. To no avail. What did make a difference however was when I gave the RichtEditableText a fixed width. So in conclusion:

    Percent width (eg. 100%) doesn't work, whereas a fixed width (eg. 300) works just fine.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 13, 2011 7:02 AM   in reply to existnresist

    I had this same issue. What i had to do was the following.

     

    messageTextFlow = null; // this was my textflow needed to null out

    richTxt.validateNow(); // this was  the refresh the RichEditableText that uses the textFlow

    messageTextFlow =TextConverter.importToFlow(__Data.Standard, TextConverter.TEXT_FIELD_HTML_FORMAT)  //this set it to the new info

    richTxt.validateNow(); // refresh to new

     

    This fixed my issue hope it helps you. I did this on my set data function.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2012 12:09 PM   in reply to existnresist

    I also encountered this bug (and spent abount a day going crazy before finally finding this thread). I attempted both of the workarounds listed by GiantRobotKitten and stubbs311, and only GiantRobotKitchen's workaround of using a fixed width for the RichEditableText was successful. Thanks and good luck to all!

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 18, 2013 3:07 AM   in reply to existnresist

    I have the same issue and i tried many ways to fix this bug. Only one works - call validateNow() method after changing textFlow in RichText. It's work for me.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points