2 Replies Latest reply on Jan 31, 2007 3:57 PM by WestSide

    Pass in ValueObject as argument to CFC???

    WestSide Level 1
      Hi,

      I am confused on how pass in arguments to the CFC when I am sending a ValueObject in from Flex. I have this code.

      public function saveEmployee( employeeVO : EmployeeVO ): void {

      var call:AsyncToken = service.saveEmployee( employeeVO );

      call.addResponder( responder );

      }

      The parameter employeeVO in the above function contains all the data the user typed in on my form. I want to pass this data to my CFC as an argument, but not sure how to do so.

      -Westside

        • 1. Re: Pass in ValueObject as argument to CFC???
          peterent Level 2
          Create a CFC that mimics the ActionScript object: EmployeeVO.cfc with properties that match your ActionScript class.
          If you've installed the free CF plugin for Flex Builder, you can have the CFC generated from the CF wizard.
          • 2. Pass in ValueObject as argument to CFC???
            WestSide Level 1
            Hi,

            I will try that because I do have those extensions installed. I got it to work without the extensions but I can't understand why this code works:

            public function saveEmployee( employeeVO : EmployeeVO ): void {

            var call:AsyncToken = service.saveEmployee( employeeVO,null );

            call.addResponder( responder );

            }

            By adding that null it seems to work. I have the cfc accepting the employeeVO as a "struct". If I remove that null, then it bombs.

            Any idea why?

            -Westside