5 Replies Latest reply on Dec 3, 2008 1:59 PM by levancho

    Map Java Object  to AS3 Object

    amol bhandwale
      Hi All,
      i have a following java value object class :
      eg :
      private long clientId;
      private boolean clientIdUpdated;

      public long getClientOrgId() {
      return clientOrgId;
      }
      public void setClientOrgId(long clientOrgId) {
      setClientOrgIdUpdated(true);
      this.clientOrgId = clientOrgId;
      }
      public boolean isClientOrgIdUpdated() {
      return clientOrgIdUpdated;
      }
      public void setClientOrgIdUpdated(boolean clientOrgIdUpdated) {
      this.clientOrgIdUpdated = clientOrgIdUpdated;
      }

      i need to convert into AS3 object class.

      Thanks.
        • 1. Re: Map Java Object  to AS3 Object
          Michael Borbor Level 4
          You should check this link http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html in the Flex Docs the section Converting data from Java to ActionScript
          • 2. Re: Map Java Object  to AS3 Object
            amol bhandwale Level 1
            thanks for reply,
            i hve created the AS3 class as follow,

            import com.adobe.cairngorm.vo.IValueObject;
            [RemoteClass(alias="com.PersonVO")]
            public class PersonVO implements IValueObject
            {
            private var _clientOrgId:Number;
            private var _clientOrgIdUpdated:Boolean;

            public function get clientOrgId():Number
            {
            return this._clientOrgId;
            }
            public function set clientOrgId(_clientOrgId:Number):void
            {
            billToAddrLine1Updated = true;
            this._clientOrgId= _clientOrgId;
            }
            public function get clientOrgIdUpdated():Boolean
            {
            return this._clientOrgIdUpdated;
            }
            public function set clientOrgIdUpdated(_clientOrgIdUpdated:Boolean):void
            {
            this._clientOrgIdUpdated = _clientOrgIdUpdated;
            }
            ................
            }

            it contains other fields also.
            when i create a object of PersonVO and set some fields at java side i am not getting exact value for each flag corresponding to fields.
            eg: for string data type for some i am getting true value even though i hve not set it at client side.

            Thanks.


            • 3. Re: Map Java Object  to AS3 Object
              amol bhandwale Level 1
              thanks for reply,
              i hve created the AS3 class as follow,

              import com.adobe.cairngorm.vo.IValueObject;
              [RemoteClass(alias="com.PersonVO")]
              public class PersonVO implements IValueObject
              {
              private var _clientOrgId:Number;
              private var _clientOrgIdUpdated:Boolean;

              public function get clientOrgId():Number
              {
              return this._clientOrgId;
              }
              public function set clientOrgId(_clientOrgId:Number):void
              {
              clientOrgIdUpdated = true;
              this._clientOrgId= _clientOrgId;
              }
              public function get clientOrgIdUpdated():Boolean
              {
              return this._clientOrgIdUpdated;
              }
              public function set clientOrgIdUpdated(_clientOrgIdUpdated:Boolean):void
              {
              this._clientOrgIdUpdated = _clientOrgIdUpdated;
              }
              ................
              }

              it contains other fields also.
              when i create a object of PersonVO and set some fields at java side i am not getting exact value for each flag corresponding to fields.
              eg: for string data type for some i am getting true value even though i hve not set it at client side.

              Thanks.
              • 4. Re: Map Java Object  to AS3 Object
                Karl_Sigiscar_1971 Level 3

                You might also want to add the [Bindable] metadata tag if you use Remote Object or [Managed] if you use the Data Management Service.

                import com.adobe.cairngorm.vo.IValueObject;

                [Bindable]
                [RemoteClass(alias="com.PersonVO")]
                public class PersonVO implements IValueObject
                {
                private var _clientOrgId:Number;
                private var _clientOrgIdUpdated:Boolean;

                public function get clientOrgId():Number
                {
                return this._clientOrgId;
                }
                public function set clientOrgId(_clientOrgId:Number):void
                {
                clientOrgIdUpdated = true;
                this._clientOrgId= _clientOrgId;
                }
                public function get clientOrgIdUpdated():Boolean
                {
                return this._clientOrgIdUpdated;
                }
                public function set clientOrgIdUpdated(_clientOrgIdUpdated:Boolean):void
                {
                this._clientOrgIdUpdated = _clientOrgIdUpdated;
                }
                ................
                }
                • 5. Re: Map Java Object  to AS3 Object
                  levancho Level 3
                  this link : http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=serialize_data_2.ht ml#312520

                  explains everything in very good details,
                  hope that helps
                  kind regards
                  Levan