1 Reply Latest reply on Dec 7, 2009 12:11 AM by Wiouou

    Cast test apparently switches types.

    Wiouou

      I'm having a strange casting problem when using livecycle and flex client classes.

       

      My setup is something like this:

      at the server side:

       

      <destination id="service">

        <properties>

          <server>

            ...

            <actionscript-class>ServiceImpl</actionscript-class>

            ...

          </server>

        </properties>

      </destination>

       

      at the client side:

       

      public interface IService {
        function get name () : String;
        function set name (name :  String) : void;
      }


      [Managed]

      [RemoteClass]

      public class ServiceImpl implements IService {

        public var serviceName : String;


        public function get name () : String {

          return name;

        }


        public function set name (name : String) : void {

          this.serviceName = name;

        }

      }


      <mx:ComboBox id="serviceComboBox" dataProvider="{services}" labelField="name" enabled="false"/>

       

       

      Now I would expect the returned object to be of class ServiceImpl.  But apparently the labelField here doesn't exist on the object.  The object is also show in the debugger as Object@... so I guess it's a dynamic object.  First I thought this was an error on the display of the debugger but it's getting a little bit weird.  With serviceName as labelField this does work and when I put a cast test on ServiceImpl the labelField name suddenly does exist on the object.  Anyone any idea why this behaviour occurs?