Ian,

Your query logic goes inside your cfc method. (pseudocode)

component
     function
         arg "userid"
         query
             queryparam "userid"
         endquery
         return query
     endfunction
endcomponent

Steve 'Cutter' Blades
Adobe Certified Expert
Advanced Macromedia ColdFusion MX 7 Developer
____________
http://blog.cutterscrossing.com


Co-Author "Learning Ext JS 3.2" Packt Publishing 2010
https://www.packtpub.com/learning-ext-js-3-2-for-building-dynamic-desktop-style-user-interfaces/book

"The best way to predict the future is to help create it"


On 3/9/2011 5:50 AM, Ian Vaughan wrote:
> Hi Dan
>
> Seem the footnote at the bottom of your post about CF7 :( as this is
> what we have here, mainly because the move is away from CF (because of
> .net influencers) hence the reason why there has been no upgrades to
> CF7, so I'm hoping that this form will help CF's case and prove it has
> still got it.
>
> So with your AJAX code if I wanted it too dynamically fill in form
> fields with employee data such as name,address, age etc which would be
> queried from a DB based on what employee number the user has filled in,
> does the AJAX code need to change to accommodate this?
>
> Then in the CFC, I take it that I would just use
>
> <cfset var user = structNew() />
> <cfset user["name"] = "User "&  arguments.name />  <cfset user["address"]
> = "User "&  arguments.address />  <cfset user["section"] = "User "&
> arguments.section/>  ......
>
> But what I can't understand is where the SQL query would go - so when a
> user fills in their employee number and clicks the button it goes and
> runs the SQL lookup on the table matching the employeenumber with the
> corresponding row in the db table.
>
> Finally you mention about CF7 I have had a look at RIA but could not
> find anything to convert data to a js string - not sure if you know of
> any? - and how does this conversion fit into your example code?
>
> Many Thanks,
>
> Ian
>
>
> -----Original Message-----
> From: Dan G. Switzer, II [mailto:[email protected]]
> Sent: 03 March 2011 18:36
> To: [email protected]
> Cc: Ian Vaughan
> Subject: Re: Database Lookup - Possible with CF?
>
> Ian,
>
> I just posted a blog entry about how easy jQuery&  CF can handle using
> AJAX to populate a form:
>
> http://blog.pengoworks.com/index.cfm/2011/3/3/Easy-AJAX-using-ColdFusion
> -jQuery-and-CFCs
>
> -Dan
>
> On 3/3/2011 10:57 AM, Ian Vaughan wrote:
>> Hi Dave
>>
>> I'm willing to give CF a go, even though here the move is away from CF
>> onto .NET and Java (ADF)
>>
>> Do you have any step by step tutorials that I could follow that I can
>> use to implement the feature below in CF, if they can see what it can
>> do it would certainly help its case.
>>
>> All I am looking to do is when a user fills in their employee number
>> in a form text field, ajax calls CF to run a SQL query to bring back
>> and populate the other fields in the form with that employees info.
>>
>> Is it really that difficult to achieve the above?  Are there any
>> ajax/jquery libraries I could use to integrate in with CF because
>> javascript is not be strong point
>>
>> -----Original Message-----
>> From: Dave Watts [mailto:[email protected]]
>> Sent: 03 March 2011 15:02
>> To: cf-talk
>> Subject: Re: Database Lookup - Possible with CF?
>>
>>
>>> So would I be better developing this application in a language that
>>> is more scaleable/future proof than CF
>> You won't be using ASP.NET then, right? Because (a) it's not more
>> scalable, and (b) any platform effectively limited to Windows is not
>> more future-proof. I mean, I could see your point if you were talking
>> about Java, even if I'd quibble on the scalability bit.
>>
>> Having worked with some high-scalability clients, I am very confident
>> that CF is as scalable as .NET. I've mentioned them on the list
>> before, so I'm not going to bother enumerating them now, but I'll be
>> happy to provide further details on request.
>>
>> Dave Watts, CTO, Fig Leaf Software
>> http://www.figleaf.com/
>> http://training.figleaf.com/
>>
>> Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA
>> Schedule, and provides the highest caliber vendor-authorized
>> instruction at our training centers, online, or onsite.
>>
>>
>>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342842
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to