Without having looked at Ben's tute, you might consider returning a
structure instead of a query or a string. Then you could bring back multiple
bits of data in the same variable.


andy

-----Original Message-----
From: Ben S [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 27, 2007 1:49 PM
To: CF-Talk
Subject: Coldfusion 8 and AJAX

Hi,

I'm experimenting with the AJAX stuff that was added with CF 8 and i'm
running in the following issue - i wonder if anyone played around with it
and could help me.

I have a cfform: 
<cfform>
        Client name: <cfinput type="text" name="clientName"
autosuggest="cfc:company.lookupCompany({cfautosuggestvalue})">
</cfform>

and a cfc to populate it with data : 

<cfcomponent output="false">
        <cffunction name="lookupCompany" access="remote" returntype="any">
                <cfargument name="search" type="any" required="false">
                        <cfset var data="">
                        <cfquery datasource="shipping" name="data">
                                select * from clients where clientName like
'#ARGUMENTS.search#%' order by clientName
                        </cfquery>
                                <cfreturn data>
        </cffunction>
</cfcomponent>

So far nothing spectacular - I actually got this from Ben Forta's tutorial.
What i would like to do is to add fields in the form and for the data to be
auto populated if a record for that clientName exists in the database. 
With the current syntax <cfreturn data> i get an error message:
error:widget: Bind failed for autosuggest clientName, bind value is not a 1D
array of strings which i don't know how to fix. 
If i write <cfreturn ValueList(data.clientName)> instead it works fine but
then i don't know how i would populate other form fields.

Any help would be appreciated. 

Thank you in advance

Ben 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287219
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