3 Replies Latest reply on Mar 25, 2010 2:55 PM by Flex harUI

    Display Object property from RemoteObject in TextArea

    trojborg

      Hello,

       

      I have the following remoteObject and Script bindings:

       

      <fx:Declarations>

              <s:RemoteObject id="Services"
                              destination="zend"
                              source="myServices"
                              endpoint="http://mySite/messagebroker/amf"
                              result="Services_resultHandler(event)"
                              fault="Services_faultHandler(event)"
                              showBusyCursor="true">           
              </s:RemoteObject>

      </fx:Declarations>

      <fx:Script>
              <![CDATA[   
                  /* IMPORTS */

       

                  [bindable]
                  protected var myResult:Object;
         
                  protected function Services_resultHandler(event:ResultEvent):void
                  {
                      myResult = event.result;
                  }

      </fx:Script>


      <s:Button label="Get" id="getButton" click="Services.getData()"/>

      <s:TextArea text="{myResult.classProperty}" height="95" textDecoration="none" />

       

      My "getButton" calls a method on the backend (PHP) which return an Object with two properties.

      Now what I would like to achieve is that my TextArea could display the content of one of those properties, but I cannot figure out a way to do this.

       

      The above code gives me a warning i Flash Builder 4 with Flex 4 SDK.:

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

       

      And nothing is displayed in my TextArea.

       

      Hope someone can explain how this should be done.

      Kind regards,

       

      Morten