Skip to main content
Known Participant
March 25, 2010
Question

New lines in RichEditableText hangs app

  • March 25, 2010
  • 2 replies
  • 4223 views

I've application when Im using RichEditableText in skin for TextInput. Also I'm binding "text" property from previosly entered text from server. If there is simple text, all is ok, if there are new lines (\n) after binding text to RichEditableText, whole app hangs or is it veeery slow. Cpu is 100%. In profiler I've found out, that there is infinite loop for recreating TextFlow objects. Really dont know what's problem.

This topic has been closed for replies.

2 replies

Participating Frequently
December 2, 2011

I have this problem occuring now as well.  I had a TextArea set to 50% width and an explicit height.  It was used to display data from the server.  Suddenly, without apparent reason, it is throwing up all over me now.  However, from the beginning I have been putting new line chars in this text field.  Whatever.  What a PAITA.

Participating Frequently
December 2, 2011

I can't reproduce this issue. Can you give us your code scrap so that we can have a deeper investigation? Thanks

Participating Frequently
December 4, 2011

Hi

I cannot because the problem appears to occur based on data from the server. This is in production already so it requires luck to catch the error in time. We are currently trying to find out just what exactly is in the string data from the server that makes the app crash. All i can send are stack traces. If we catch the error in real time before it gets replaced on the server, i will hopefully have the actual string data that reproduces the problem. Please dont hold your breath though.

Sent from my iPhone

Known Participant
March 25, 2010

and this is code from skin

<s:RichEditableText id="textDisplay"
                            multiline="{hostComponent.multiline}"
                            lineBreak="toFit"
                            color="{hostComponent.textColor}"
                            fontFamily="{hostComponent.fontFamily}"
                            fontSize="{hostComponent.fontSize}"
                            focusedTextSelectionColor="0xddf1f8"
                            left="6" right="1" top="4" bottom="1"
                            kerning="off"
                            heightInLines="{hostComponent.lines}"
                            >
        </s:RichEditableText>

Adobe Employee
March 26, 2010

I am not able to reproduce the problem, I think because of the bindings. Can you send me an example that has static text, fontSize, heightInLines, etc. defined? If its a bug in our code, we would really like the opportunity to fix it.

Thanks!

- robin

Known Participant
April 6, 2010

ok, im trying to fix this now, so that's why I'm replying later

First test and found first problem. When I have strings with \n inside and do not set width and height (need to set both to fix problem) in Profiler you can see infinity loop which try to find out correct size (dont know if this is problem of layout component itself, or together with RichEditableText, but for text without \n it works correctly

Here is example code. You can try to change textData in init() function and run in in profiler (SDK 4.0.14403). To fix problem set width for all 3 instances of RichEditableText.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/halo"
               minWidth="1024" minHeight="768"
               applicationComplete="init()"
               xmlns:components="com.bbdo.totalWorkPlanner.app.view.components.*">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
   
    <s:HGroup>
        <s:BorderContainer>
            <s:RichEditableText id="textInput"
                                multiline="true"
                                lineBreak="toFit"
                                height="200"
                                color="0xaaaaa"
                                left="6" right="1" top="4" bottom="1"
                                kerning="off"
                                heightInLines="10"
                                >
            </s:RichEditableText>
        </s:BorderContainer>
        <s:Button label="update" click="update()"/>
        <s:VGroup>
            <s:BorderContainer>
                <s:RichEditableText id="textDisplay1"
                                    text="{textData}"
                                    height="200"
                                    multiline="true"
                                    lineBreak="toFit"
                                    color="0xaaaaa"
                                    left="6" right="1" top="4" bottom="1"
                                    kerning="off"
                                    heightInLines="10"
                                    >
                </s:RichEditableText>
            </s:BorderContainer>   
            <s:BorderContainer>
                <s:RichEditableText id="textDisplay2"
                                    text="{textData}"
                                    height="30"
                                    multiline="false"
                                    lineBreak="toFit"
                                    color="0xaaaaa"
                                    left="6" right="1" top="4" bottom="1"
                                    kerning="off"
                                    heightInLines="1"
                                    >
                </s:RichEditableText>
            </s:BorderContainer>
        </s:VGroup>
    </s:HGroup>
   
    <fx:Script>
        <![CDATA[
            [Bindable]
            public var textData:String;
           
            private function init():void
            {
                //textData = "Fearful criminals.    \n\nAlso theme-based super-villians.  Or super-villians too interested in villiany to establish a theme (i.e. slackers).  \n\nBasically any bad-guys that can be defeated by being beaten up by a guy who wears his underwear on the outside of his pants and talks in a growly voice.";
                textData = "test data.";//    \n\ntest  \n\ndata";
            }
            private function update():void
            {
                textData = textInput.text
                trace(textData);
            }
        ]]>
    </fx:Script>
   
</s:Application>

But this was not my main problem. I just found this when trying to found problem itself.

Now there is infinite calling of SizesAndLimit (for VerticalLayout and HorizontalLayout) and LayoutElementFlexChildInfo (for VerticalLayout)

in my app, there are command about creating TextFlow (or something similar) I will provide information later today