Web Trenches

Ajax Features in ColdFusion 8



I gave a presentation titled "Introductionto Ajax Features in ColdFusion 8" at the Syracuse ColdFusion User Group meeting this week.   In the presentation, I covered the following.

  • The basic layout elements that are used with Ajax
  • Automatic Ajax – Things that ColdFusion 8 handles for you – without needing to program any JavaScript.
  • Almost-Automatic Ajax – Things that require one or two lines of code, but not extensive use of JavaScript.
  • Manual Ajax – These are the most powerful features, but will require some JavaScript coding.
  • Ajax Goodies – A couple smal small features in CF8 with big impact.

There is also a sample application that shows an employee management database interface created using all CF8 Ajax – no page reloads.  

 View the presentation content here…

Download all the code, including the presentation code …

NOTE: In order to run the samples on your server, you will need ColdFusion 8.  A couple of the samples, including the full application, require MySQL (or another database).  Run the ajaxpreso.sql file (included) on your MySQL database and set up a CF DSN called 'ajaxpreso'.  The tables aren't very complicated – if you run MS SQL, just look at the .sql file and you'll see how the tables are set up.  You can set those up manually.

6 Replies to “Ajax Features in ColdFusion 8”

  1. Thanks for this! Some of these samples explain things that Adobe left out of all their docs. This is a big help as I learn how to make all this stuff work. Are all the ColdFusion.Layout functions documented somewhere?

  2. Hey,

    Is there any way we can load content inside a div by passing div id and url in javascript.

    I want to know whether its possible to direclty do with cf8 ajax tags with the minmal use of javascript.

    I ahve seen numerous examples in cf8 ajax features but not the logic i have mentioned above.

    Any advice or suggesstion wil really help…

    Thanks,
    Anhijit

  3. Anhijit,

    You should be able to accomplish this using the ColdFusion.navigate function like this:

    Just call it like this:
    loadDIV(‘http://my.url.com’,’myDivId’)

    Docs on ColdFusion.navigate are here:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=JavaScriptFcns_24.html

    I think that is “minimal” use of JavaScript. If you want to simplify it even more, you could just call the JavaScript line directly:
    ColdFusion.navigate(‘http://my.url.com’,’myDivId’);

  4. Hey thanks a lot…I just printed my own name wrong………..I am getting the error ColdFusion is not defined…

    My code is in inetpub/wwwroot/…

    Regards,

    Abhijit

Leave a Reply

Your email address will not be published. Required fields are marked *