You will need to return a value using cfreturn . Try this.

<cfcomponent>
<cffunction name="getEmp" access="remote">
<cfargument name="lastName" required="true">
<cfset var empQuery="">
<cfset var MyVar="">
<cfquery name="empQuery" datasource="OLO">
SELECT *
FROM owners
WHERE family_name = '#arguments.lastName#'
</cfquery>
<cfsavecontent variable="MyVar">
<cfoutput>Results filtered by #arguments.lastName#:</cfoutput><br>
<cfdump var=#empQuery#>
</cfsavecontent>
    <cfreturn MyVar>
</cffunction>
</cfcomponent>





On Fri, Oct 17, 2008 at 5:14 PM, mikeashields <[EMAIL PROTECTED]>wrote:

> I've crawled inside and out of the documentation for how to pass html form
> data to a cfc and display the result (see
>
> http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=buildingComponents_15.html
> )
> but -- possibly due to "If the CFC returns a result using the cfreturn tag,
> ColdFusion converts the text to HTML edit format, puts it in a WDDX packet,
> and includes the packet in the HTML that it returns to the client." -- I
> cannot find any way to display the results of passing info either by form
> or
> URL ( all that happens on form submit is this url
> http://70.XX.XX.XX:8500/olo/cfc/SearchOwners.cfc?method=getEmp in the
> address bar and a completely empty screen).
>
> My .CFM FIle:
> <h2>Find People</h2>
> <form action="../cfc/SearchOwners.cfc?method=getEmp" method="post">
> <p>Enter employee's last Name:</p>
> <input type="Text" name="lastName">
> <input type="Hidden" name="method" value="getEmp">
> <input type="Submit" title="Submit Query"><br>
> </form>
>
>
> My .CFC File
> <cfcomponent>
> <cffunction name="getEmp" access="remote">
> <cfargument name="lastName" required="true">
> <cfset var empQuery="">
> <cfquery name="empQuery" datasource="OLO">
> SELECT *
> FROM owners
> WHERE family_name = '#arguments.lastName#'
> </cfquery>
> <cfoutput>Results filtered by #arguments.lastName#:</cfoutput><br>
> <cfdump var=#empQuery#>
> </cffunction>
> </cfcomponent>
>
> Yet this invoke cfm works no problem returning results
> <body>
> <!--- Invoke Component. --->
> <cfinvoke component="olo.cfc.SearchOwners" method="getEmp"
> returnvariable="qResult">
> <cfinvokeargument name="lastName" value="Shields"/>
> </cfinvoke>
> </body>
> --
> View this message in context:
> http://www.nabble.com/form-info-to-a-cfc-tp20041166p20041166.html
> Sent from the Cold Fusion - Technical mailing list archive at Nabble.com.
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314073
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to