7 Replies Latest reply on Dec 23, 2009 11:52 PM by Flex harUI

    Clearing a TextArea TextFlow

    jdesko Level 2

      What is the proper way to clear a TextArea TextFlow?

       

      I have TextArea's that use TextConverter to import TextFlow, at times I need to clear the TextFlow, I was originally doing

      myTextArea.textFlow = null;

      now using this I get an error of undefined.  I am using sdk 12879.

       

      I can have a statement that says:

      if(myTextArea.textFlow != null)  // this works - but again I can't set textFlow = null

       

      To clear the textflow I can do

      myTextArea.textFlow = new TextFlow() // this works

       

      If this matters I did see a mention of

            - Properties now treat null as undefined - this is to support flex data binding which sets properties to null with great frequency

      in

      http://forums.adobe.com/message/2370072#2370072

       

      Thanks,

      John

        • 1. Re: Clearing a TextArea TextFlow
          ellamit

          This is already fixed in build 13162.

          You can set textFlow="{null}" in mxml or textFlow=null in AS

          • 2. Re: Clearing a TextArea TextFlow
            jdesko Level 2

            Hello ellamit;

             

            I upgraded to sdk #13175 and still have the same problem.  I downloaded the sdk from:

            http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4; *I didn't see mention of this fix in this sdk, not for 13162 or anywhere else ... did I miss something?

             

            In AS I have a simple function:

             

            if (textArea.textFlow != null)

                 textArea.textFlow = null;

             

            and below is the error that I get:

             

            Picture 1.png

             

            Thanks,

            John

            • 3. Re: Clearing a TextArea TextFlow
              Flex harUI Adobe Employee

              Most everyone at Adobe in the US is on holiday.  Can you post a 20-line test case?

               

              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

              Blog: http://blogs.adobe.com/aharui

              • 4. Re: Clearing a TextArea TextFlow
                jdesko Level 2

                Hello Alex;

                 

                Thanks for the reply.  Just my luck, in a new project everything works okay.  As I mentioned, in my production project textFlow = null was working, then it stopped,  I upgraded to the latest sdk, cleaned and cleaned, but it is still not working.  I don't know if somewhere along the line something changed and that's why ellamit said it was fixed in 13162, but it seems cleaning would take care of that?

                 

                Any suggestions would be much appreciated.

                 

                Thanks,

                John

                • 5. Re: Clearing a TextArea TextFlow
                  jdesko Level 2

                  In my production project, in a new module, I created a TextArea and in AS I cleared using textFlow = null, and it worked.  I can't see what I'm doing different in my existing mods that were working and now are not?

                   

                  John

                  • 6. Re: Clearing a TextArea TextFlow
                    jdesko Level 2

                    Hello Alex and ellamit;

                     

                    Thank you for your help.  I found my problem and now working on a solution, I'll probably have to call this one user error even though I don't understand the logic behind it; but if my limited memory serves me right all textArea = null was a problem, but after upgrading sdk's I was still seeing it from one custom component.

                     

                    In brief, this comp. has an editable TextArea, the comp. also has a [Bindable] TextLayoutFormat var that when the TextArea has a selection change it uses the var to get and set the text format of TextArea (simpler done than said), but TextArea is not bound to it and does not call it unless there's a selection change.

                     

                    What I don't understand in the above situation is :

                     

                    if (textArea.textFlow != null)  // solves true

                      textArea.textFlow = null     // still fails, even if text was typed and there was no selection change, so the var was never called

                     

                    Thanks again,

                    John

                    • 7. Re: Clearing a TextArea TextFlow
                      Flex harUI Adobe Employee

                      Well, if you have time to narrow it down more, you can file a bug.  Maybe you found a particular configuration where it doesn't work.

                       

                      Alex Harui

                      Flex SDK Developer

                      Adobe Systems Inc.

                      Blog: http://blogs.adobe.com/aharui