0 Replies Latest reply on Feb 28, 2007 6:56 AM by YossarianXOS

    Data Type Problems using RemoteObject calls to ColdFusion

    YossarianXOS Level 1
      I seem to be having some sort of typing issue that I'm unable to resolve even when I try to explicity cast variables before sending. I have a CFC that I am doing a RemoteObject call on, and several of the parameters require numeric data types. Regardless of what I pass I keep getting back. Note that other methods I call from this RO do work. It seems to be a problem with these method calls sending out only strings for all the arguments.
      quote:

      The argument NEWSLETTER passed to function doBasicProfile() is not of type numeric.

      Here is the RO call:
      quote:


      <mx:method name="doBasicProfile" concurrency="last" result="doBasicProfileHandler()" fault="mx.controls.Alert.show(event.fault.faultString, 'Error')">
      <mx:arguments>
      <profileID>{parentApplication.profileInfo.profileID}</profileID>
      <communityID>{parentApplication.communityID}</communityID>
      <hobbyList>{parentApplication.profileInfo.groupList}</hobbyList>
      <oem>{parentApplication.oemID}</oem>
      <zipCode>{parentApplication.profileInfo.zipCode}</zipCode>
      <city>{parentApplication.profileInfo.city}</city>
      <state>{parentApplication.profileInfo.state}</state>
      <country>{parentApplication.profileInfo.country}</country>
      <gender>{parentApplication.profileInfo.gender}</gender>
      <email>{parentApplication.profileInfo.email}</email>
      <dob>{parentApplication.profileInfo.dob}</dob>
      <aboutme>{parentApplication.profileInfo.aboutme}</aboutme>
      <newsletter>{parentApplication.profileInfo.optIn}:int</newsletter>
      <maritalstatus>{parentApplication.profileInfo.maritalstatus}</maritalstatus>
      <hometown>{parentApplication.profileInfo.hometown}</hometown>
      <highschool>{parentApplication.profileInfo.highschool}</highschool>
      <occupation>{parentApplication.profileInfo.occupation}</occupation>
      </mx:arguments>
      </mx:method>



      All the "parentApplication.profileInfo.*" variables come from a custom class UserProfile that has been instantiated and filled with data from a mix of forms and a previous RO call. All the variables are typed, and I've even tryed to explicity cast the problem arguments using int(), Number(), parseInt(), and parseFloat(), as well as changing the var types in the UserProfile class, with no luck.

      quote:


      [Bindable]
      public class UserProfile
      {

      public var profileID:int;
      public var oemID:int;
      public var communityID:int;

      public var country:String = "US";
      public var state:String = "NA";
      public var city:String = "";
      public var zipCode:String = "";
      public var gender:String = "male";
      public var email:String = "";
      public var dob:String = "";
      public var aboutme:String = "";

      public var newsletter:int;
      public var optIn:int;

      public var maritalstatus:String = "Single";
      public var hometown:String = "";
      public var highschool:String = "";
      public var occupation:String = "";


      public var favoriteMovies:String = "";
      public var favoriteTV:String = "";
      public var favoriteStars:String = "";
      public var favoriteMusic:String = "";
      public var favoriteSingers:String = "";
      public var favoriteFoods:String = "";
      public var favoriteBooks:String = "";
      public var favoritePolitics:String = "";
      public var favoriteSuperHeroes:String = "";
      public var dreamJobs:String = "";
      public var dreamVacations:String = "";
      public var dreamSpouse:String = "";
      public var otherDreams:String = "";

      public var privacy:int;
      public var groupList:String = "0";

      public function UserProfile() {

      }
      }



      Is there some other way to tell Flex to send particular arguments as numeric data types? It really seems like for some reason I've integers that are getting sent as strings. Heck, I've even tried setting <newsletter>999</newsletter> and I'm still getting the same error.