5 Replies Latest reply on Jul 15, 2011 8:43 AM by jfb00

    Extended texInput issue

    jfb00 Level 3

      Hi, Yesterday I created an extended component for textInput.

      http://forums.adobe.com/thread/876786?tstart=30

       

      Now, when I try to pass my realValue to my method argument:

      <mx:method name="addNew" result="addNew_RO_Handler(event)">
                  <mx:arguments>
                      <number_id>myField.realValue</number_id>

       

      I am getting this alert:

      Data binding will not be able to detect assignments to "realValue".

       

      I am setting to get the value with:

       

      public function get realValue():String

      {

           //Return component text real value

           return _realValue;

      }

       

      What is missing?

      Thanks

       

      JFB

        • 1. Re: Extended texInput issue
          UbuntuPenguin Level 4

          You didn't make "realValue" bindable.  To be honest, since you are using it in a service call, I don't think you have too much to worry about.  But if you want to make the warning go away and for future reference try this.

           

          public function set realValue(value:String):void            
          {                
               //Set real value                
               _realValue =
               value;                                
               // format the number here                
               super.text = formatDecimal(Number(_realValue));
               dispatchEvent( new Event(
          "realValueChange") );       
          }
          [Bindable(Event="
          realValueChange")]                        
          public function get realValue():String            
          {                
               //Return component text real value                
               return _realValue;            
          }
          • 2. Re: Extended texInput issue
            jfb00 Level 3

            The message is gone but the value come as zero. When I debug and point to realValue i can see the number.

            Any ideas?

            Thanks

             

            JFB

            • 3. Re: Extended texInput issue
              UbuntuPenguin Level 4

              Wait a minute ?  Do you have

               

              _realValue = value; or

              reaValue = value ?

              • 4. Re: Extended texInput issue
                jfb00 Level 3

                _realValue = value;

                 

                JFB

                • 5. Re: Extended texInput issue
                  jfb00 Level 3

                  The weird thing is, when i debug i can see the value as:  realValue = 6565 [0x19a5]

                  But in my method arguments shows as NaN.

                  I convert realValue to handle number instead of string but the same issue.

                  Is this a posible bug?

                   

                  Thanks

                   

                  JFB