Passing Parameters To CFC

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  1. #1

    Default Passing Parameters To CFC

    I am testing how to return data from a CFC within Flash Forms. I have a simple
    <cfselect> tag that will hold data returned from a CFC. This CFC returns all
    records and works fine. I call the CFC with a simple tag (as follows):

    <cfset getRegions = application.regionGateway.getRecords() />

    This will work for my <cfselect> and show all the records returned. However,
    the CFC does accept an argument that can help pair the data down.

    How can I pass a parameter using the above code in order to get the results I
    want to display?

    Natty2112 Guest

  2. Similar Questions and Discussions

    1. Question on Passing URL Parameters
      Thanks in advance for any responses to this question! I have a dynamic table (in a master page using javascript and asp) that links to a detail...
    2. cflocation - passing parameters
      Hi, Is it possible to do the following with CF? If not how can it be done. <cflocation url='template.cfm?id=#id#'> Thanks in advance
    3. passing parameters
      Hi Michael, I think you want to modify the links in web control programmatically. You can add several Hyperlink controls to the user control,...
    4. Passing Parameters into NEW()
      Is there any way that the NEW() of a web service can accept parameters ? I would like to pass a boolean to indicate to the webservice that I am in...
    5. Help Passing Parameters
      Before going to the third script I'd suggest storing the variables in session variables. Here's how I generally do login scripts. Perhaps have...
  3. #2

    Default Re: Passing Parameters To CFC

    Here is some pseudocode. It assumes the component is stored as
    records.cfc in the current folder.

    records.cfc
    ============
    <cfcomponent>
    <!--- the method accepts an argument, returns a query --->
    <cffunction name="getRecords" returntype="query">
    <cfargument name="myVar">
    <cfquery name="myQuery">
    </cfquery>
    <cfreturn myQuery>
    </cffunction>
    </cfcomponent>

    Then, on the page containing the cfselect, you will do something like

    <!--- create component object --->
    <cfset recordsObj = createobject("component", "records")>
    <!--- get the query from the component --->
    <cfset myRecords = recordsObj.getRecords(someVar)>
    <!--- use the query in the cfselect --->
    <cfselect query="myRecords">



    BKBK Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139