6 Replies Latest reply on Sep 5, 2008 7:39 AM by Newsgroup_User

    Need Help with TextArea :(

    masita18
      I have a main application and a component.

      Component:
      Consist of a textArea. And...
      A initialize method:
      private function initApp(e:FlexEvent):void {
      //default text
      txtDesc.text = "As "+lblCauseObjVar.text+" increases "+lblEffectedObjVar.text+" "+ viewstack1.selectedChild.label + "because: ";
      }

      or

      Instead of the initialize method, i also tried using this way.
      I have also tried setting the text on the textArea itself:
      <mx:TextArea id="txtDesc" text="As {lblCauseObjVar.text} increases {lblEffectedObjVar.text} {vsGradient.selectedChild.label} because: " x="10" y="482" width="460" height="87" />

      Main application:
      This is where I retrive data from the database and display the following data in the textArea.
      private function resultGetRShipData(event:ResultEvent):void{
      //Store all the data in _rShipTest
      _modelDB = event.result as ModelDb;

      rlnEditor.txtDesc.text = modelDB.variableDesc;
      }

      Now I'm having problem to display the data that i retrive from the database. There is no issue of retrieving the data. The problem only occur when displaying it. When run, it will display the default text instead of the data that had been retrieve from the database.
        • 1. Re: Need Help with TextArea :(
          Level 7

          "masita18" <webforumsuser@macromedia.com> wrote in message
          news:g9nvkv$8sd$1@forums.macromedia.com...
          >I have a main application and a component.
          >
          > Component:
          > Consist of a textArea. And...
          > A initialize method:
          > private function initApp(e:FlexEvent):void {
          > //default text
          > txtDesc.text = "As "+lblCauseObjVar.text+" increases
          > "+lblEffectedObjVar.text+" "+ viewstack1.selectedChild.label + "because:
          > ";
          > }
          >
          > or
          >
          > Instead of the initialize method, i also tried using this way.
          > I have also tried setting the text on the textArea itself:
          > <mx:TextArea id="txtDesc" text="As {lblCauseObjVar.text} increases
          > {lblEffectedObjVar.text} {vsGradient.selectedChild.label} because: "
          > x="10"
          > y="482" width="460" height="87" />
          >
          > Main application:
          > This is where I retrive data from the database and display the following
          > data
          > in the textArea.
          > private function resultGetRShipData(event:ResultEvent):void{
          > //Store all the data in _rShipTest
          > _modelDB = event.result as ModelDb;
          >
          > rlnEditor.txtDesc.text = modelDB.variableDesc;
          > }
          >
          > Now I'm having problem to display the data that i retrive from the
          > database.
          > There is no issue of retrieving the data. The problem only occur when
          > displaying it. When run, it will display the default text instead of the
          > data
          > that had been retrieve from the database.

          Where are lblCauseObjVar, lblEffectedObjVar, etc., set?


          • 2. Re: Need Help with TextArea :(
            masita18 Level 1
            They are set at the component side.
            • 3. Re: Need Help with TextArea :(
              Level 7

              "masita18" <webforumsuser@macromedia.com> wrote in message
              news:g9q4ob$mu7$1@forums.macromedia.com...
              > They are set at the component side.

              I was asking for code...


              • 4. Need Help with TextArea :(
                masita18 Level 1
                here are the codes.
                • 5. Re: Need Help with TextArea :(
                  SujitG Level 2
                  Hi,

                  When are u invoking the initApp() function and when are u invoking the rlnEditor.txtDesc.text = modelDB.variableDesc; statement?
                  My point is, if the initApp() function is invoked after the second statement then there is a possibility that the default text is set to the TextArea.

                  As Amy mentioned,it will be easy to help if you can share the code of your component and the part of the code where you are initializing and invoking the the calls on the component instance created in the main application.

                  Hope this helps.
                  • 6. Re: Need Help with TextArea :(
                    Level 7

                    "masita18" <webforumsuser@macromedia.com> wrote in message
                    news:g9qn8j$bjn$1@forums.macromedia.com...
                    > here are the codes.
                    >
                    > <mx:Label id="lblCauseObjVar" text="{lblCObj.text} - {lblCVar.text}"
                    > x="10"
                    > y="59.5" width="218" height="24" fontSize="12" fontFamily="Verdana"
                    > textAlign="left" textDecoration="normal"/>
                    >
                    > <mx:Label id="lblEffectedObjVar" text="{lblEObj.text} - {lblEVar.text}"
                    > x="10"
                    > y="115.5" width="218" height="24" fontSize="12" fontFamily="Verdana"
                    > textAlign="left" textDecoration="normal"/>

                    What event(s) is/are causing your initApp function to run?

                    Where are lblCObj, lblCVar, etc. being set?

                    Why are you so reluctant to give full information?