3 Replies Latest reply on Oct 25, 2006 2:23 AM by rkschulz

    validateNow() not working on textArea as claimed

    Opsware_Jeff Level 1
      According to the Adobe® Flex™ 2 Language Reference for Class TextArea, one is supposed to call validateNow() on a textArea to sync up the htmlText and text properties after programatically setting one of them.

      This seems to not be working.

      I have a textArea in which I've set the htmlText property. I have a function on my textArea that selects the whole word when the word is enclosed in curly braces and the user clicks on it. I then programmatically replace the textRange according to what the user wants to something with fewer characters and styled via htmlText. This is nicely reflected in the textArea. However, looks are deceiving, because if the user clicks on that same word again, the selection is offset by the difference in length of the old and new strings.

      I created a button to call validateNow() on the textArea to force the htmlText to get pushed to the text property, but it doesn't work.

      The only way I can currently force them to sync up is to manually click in the text area and type a junk character (and then delete it). After that, my auto selection function works correctly again, because the htmlText is now once again in sync with the text property, as it was in the starting condition.

      Any ideas how to get validateNow() to work as advertised?

      Cheers,
      Jeff