I'm sitting in Steve Rittler's CFAjax session right now. Steve's giving some background on Ajax as well as showing the process flow. Basically, "how it works". (x)HTML uses JavaScript to talk to an Ajax object. Ajax object makes an http request to a back end system, in this case ColdFusion. ColdFusion returns xml to the ajax object, which again uses JavaScript to deal with the returned data on the client.

Besides CFAJax, there's also ajaxCFC (by Rob Gonda). It uses a slightly different approach. There are also several non-CF specific Ajax frameworks which can be used.

CFAjax works with CF 6.0 and above. Requires JavaScript. The client must also support the XMLHttp object. CFAjax can return Structs, Query's and Arrays in addition to XML.

Steve's moving into some simple examples now. It's a speaker search where you start typing a last name in a form field and Ajax is used to send the info as you type, updating the form field with possible matches. This is basically the way Google Suggest works.

Cross browser support in Ajax can be really difficult. One of the big issues Steve faced is the way most Ajax libraries require you to embed all sorts of HTML within your JavaScript. It's verbose at best. It requires DOM manipulation, which is also a huge pain for cross browser support. His solution is to use "templates". He cautions this isn't for everyone, but in their case, it works well and has a lot of real world deployments.

Pros of the templating system include returning HTML - there's no hard coded DOM work. It's also, in Steve's words "very, very, very easy". The cons are that it feels a bit dirty, and may rub purists the wrong way. Again, there's a cost benefits analysis to be done. He shows the simple example again, this time using the templating system.

Steve's mentioning upcoming Ajax trends include Ajax/Flex integration (they actually complement each other) as well as mobile Ajax.

Lots and lots of "how do I do..." questions coming from the audience. There's obviously a lot of interest in this topic. Steve's doing a good job of answering them. This presentation could definitely span multiple sessions.

Steve looks to be wrapping up with an example of how to integrate CFAjax within the Mach-II framework. It's very similar in ModelGlue as well. He's showing the demonstration from within an application his company created called RecruitWeb. It's a pretty slick application for use by athletic recruiting departments. The application is completely written in ColdFusion using Mach-II as the framework and AjaxCFC. If you are interested in the mechanics of the integration, I believe Steve is making the techniques available on his company's website, I'm sure he'd be glad to give a fuller explanation.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)



Copyright 1995-2010 Rob Brooks-Bilson. All rights reserved.
Aura skin for Raymond Camden's BlogCFC inspired by Joe Rinehart & Steven Erat. This blog is running version 5.9.004.