0 Replies Latest reply on May 5, 2007 12:00 AM by jasenm

    Binding Extended CFC to local Flex Value Objects (using Cairngorm 2.1)

    jasenm Level 1
      Hi

      Are there any issues with returning extended CFC's back to flex as a remote object

      I have the following...(I have cut most of the code out to save space)

      Here are the remote CFC's:

      aAssetObjectDTO: Base CFC

      <cfcomponent output="false" alias="com.fullcircle.dci.dto.aAssetObjectDTO">
      <cfproperty name="aLabel" type="string" default="">
      <cfproperty name="aData" type="string" default="">

      <!--- init defaults --->
      <cfscript>
      //Initialize the CFC with the default properties values.
      this.aLabel = "";
      this.aData = "";

      <cffunction name="init" output="false" returntype="aAssetObjectDTO">
      <cfreturn this>
      </cffunction>

      ...getters/setters here...

      </component>


      aEmailDTO:
      <cfcomponent alias="com.fullcircle.dci.dto.aEmailDTO" extends="com.fullcircle.dci.dto.aAssetObjectDTO">
      <cfproperty name="aDate" type="string" default="">
      <cfproperty name="aFrom" type="string" default="">
      <cfproperty name="aMessagenumber" type="numeric" default="">

      <cffunction name="init" output="false" returntype="aAssetObjectDTO">

      <cfscript>
      super.init()
      </script>


      <cfreturn this>
      </cffunction>

      ...
      getter/setter functions here
      ...
      </component>

      ..And here are the flex AS3 data transfer objects..

      aAssetObjectDTO: Base Class

      package com.fullcircle.dci.dto
      {
      //com.fullcircle.dci.dto.aAssetObjectDTO
      [RemoteClass(alias="com.fullcircle.dci.dto.aAssetObjectDTO")]

      [Bindable]
      public class aAssetObjectDTO
      {
      public var aLabel:String="";
      public var aData:String="";

      public function aAssetObjectDTO()
      {
      trace("ONCONSTRUCTOR: com.fullcircle.dci.dto.aAssetObjectDTO()")
      }
      }
      }


      aEmailDTO:
      package com.fullcircle.dci.dto
      {
      import com.fullcircle.dci.dto.aAssetObjectDTO;
      [RemoteClass(alias="com.fullcircle.dci.dto.aEmailDTO")]

      [Bindable]
      public class aEmailDTO extends aAssetObjectDTO{

      public var aDate:String = "";
      public var aFrom:String = "";
      public var aMessagenumber:Number = 0;

      // ....other properties removed..

      public function aEmailDTO()
      {
      trace("ONCONSTRUCTOR: com.fullcircle.dci.dto.aEmailDTO");
      super();
      }
      }
      }




      I have been using ServiceCapture to monitor my remoting object, which returns ONLY the EmailDTO properties, however when I use SoapScope to test as WSDL I receive the ENTIRE extended object, both emailDTO and AssetObject properties like you would expect.

      The only things I can think of, is my binding does not work with the extended objects, it does not seem to be the coldfusion remote object that fails (considering when I use SoapScope (WSDL) the entire extended cfc properties are returned correctly as expected)

      or

      am I initialising the the extended cfc incorrecty, by using super.init()?? - (Which does not seem to matter when I soapscope for the results...)

      Which leads me to the question...is there some thing fundametal I am missing/doing wrong, or are there issues with using coldfusion extended cfc's and flex extended flex classes when converting extended coldfusion remote objects to actionscript objects?

      Hope that all make some kind of sence

      Thanks for help you guys can offer.

      Jasen