0 Replies Latest reply on Aug 6, 2007 9:02 AM by morecarl

    Passing data from Flex 2 to CFC Arguments

    morecarl
      I have a large CF application which heavily utilizes CFCs for interaction between the UI and the database. I am considering changing the UI to Flex, but I am not sure how to pass specific arguments to the CFCs from Flex?

      For the mostpart, the CFC arguments are not required, and are used as optional filtering criteria in the queries when they are defined.

      How can I explicitly pass an individual argument in to the CFC? The only example of passing in args that I have seen constructed an array with all of the arguments and passed the array to a single <cfargument> tag in the CFC. This approach would require significant changes to my CFCs.

      e.g.
      <cffunction name="getPOList" access="public" returntype="query" output="false">

      <cfargument name="PROJECT" type="string" required="no">
      <cfargument name="REGION" type="string" required="no">
      <cfargument name="MARKET" type="string" required="no">
      ...

      <cfquery datasource="..." name="POList">
      SELECT
      PO_MASTER.PURCHASE_DOC,
      PO_MASTER.SITE_NAME,
      PO_MASTER.CUSTOMER_SITE_REF,
      ...
      FROM PO_MASTER,
      WHERE
      ...
      <cfif isdefined("ARGUMENTS.PROJECT")>
      <cfif ARGUMENTS.PROJECT IS NOT "ALL" AND ARGUMENTS.PROJECT IS NOT "" >
      AND NVL(S.PROJECT, 'Undefined') = '#ARGUMENTS.PROJECT#'
      </cfif>
      </cfif>

      <cfif isdefined("ARGUMENTS.REGION")>
      <cfif ARGUMENTS.REGION IS NOT "ALL" AND ARGUMENTS.REGION IS NOT "" >
      AND NVL(S.PROJECTREPREGION, 'Undefined') = '#ARGUMENTS.REGION#'
      </cfif>
      </cfif>

      <cfif isdefined("ARGUMENTS.MARKET")>
      <cfif ARGUMENTS.MARKET IS NOT "ALL" AND ARGUMENTS.MARKET IS NOT "" >
      AND NVL(S.PROJECTREPZONE, 'Undefined') = '#ARGUMENTS.MARKET#'
      </cfif>
      </cfif>
      ...