macromedia.coldfusion.flash_integration
[Top] [All Lists]

Re: Passing Parameters To CFC

Subject: Re: Passing Parameters To CFC
From: "BKBK" <webforumsuser@xxxxxxxxxxxxxx>
Date: Mon, 31 Dec 2007 11:10:45 +0000 (UTC)
Newsgroups: macromedia.coldfusion.flash_integration

Here is some pseudocode. It assumes the component is stored as 
[i]records.cfc[/i] 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">




<Prev in Thread] Current Thread [Next in Thread>