blog | bio | agenda | jobs | ajaxCFC

AjaxCFC for jQuery Alpha2 Release

AjaxCFC for jQuery is almost ready and I just uploaded to RIAForge the new Alpha 2 release. You may sync up your SVN repository or if you don't use source control, use RIAForge's zip download utility to fetch the latest version. Once you download the zip file, the jQuery related code is located in the branches/jquery folder.

I am using the just released jQuery 1.1, so if you drop this code on an old site using jQuery, you probably want to download the back-compatibility plugin.

Like I mentioned in my alpha 1 post, I included a plugin to maintain DWR syntax compatibility, and to illustrate it, I updated a few examples to use this code instead of DWR. Thus far, the only significant different I found is when returning a query using JSON serialization method (default on this release). The syntax to access the query columns is a little different, as you will see in the examples and soon-to-come documentation.

Among some other changes, I updated logging, error trapping, security checks, constructor methods, serialization capabilities, and more.

Most of these changes affect the DWR and jQuery version since the Ajax.cfc core file is shared between them.

Constructor method: many of you tried to extend your existing domain model objects and provide remote methods inside them. Although I don't particularly agree with this practice, I don't want to restrict it. AjaxCFC used to rely on it's built-in init method constructor, which interfered with you own component once extended, so I renamed the AjaxCFC to allow your objects to contain an init() method.

Error trapping: AjaxCFC catches most errors in your components and by default, alert you with the error message. I added the file and line number since sometimes the message was not enough. I also added a method to optionally popup a window showing the error dump, which is extremely useful because you can see the full trace... to enable this just invoke the setPopupErrorDump(true) method inside your CFC.

Security Check (for jQuery version only): jQuery sends additional x-header data in the http request, so I added an option to check for it, to prevent access to the CFC if it's accessed by any method other than an XmlHttpRequest. To enable it just invoke the setCheckHttpRequestData(true) method inside your CFC. In fact, by default AjaxCFC ships with all the security methods turned off, for easier debugging. It is advisable to turn them on by calling: setAllowedVerbs('post'); setCheckHTTPReferer(true); setPopupErrorDump(false); setCheckHttpRequestData(true);

Serialization (for jQuery only): The new AjaxCFC is able to serialize using pure JS, JSON, or WDDX. I haven't fully benchmarked the performance differences, so for now just use the one you like the most.

Logging: I updated the log4javascript version, plus I added a little more information in the request logs.

Documentation will be included with the beta release.

Please note that despite some comments out there, this release does not mean that AjaxCFC switched to jQuery. This release is a branch using a different Ajax engine, and both versions will continue to be updated and supported.

That's it for now, please report any issues using RIAForge's bug tracker.

Enjoy.

Related Blog Entries

TrackBacks
AjaxCFC Updated by Rob Gonda
AjaxCFC, arguably the most widely used Ajax/ColdFusion component library for ColdFusion, has been updated
Tracked by Rey Bango's Blog | Tracked on 1/15/07 11:07 AM

Trackback URL for this entry:
http://www.robgonda.com/blog/trackback.cfm?24662BBC-3048-7431-E45D0FE2E46CF540

Comments
Way to keep on top of things Rob. Kudos!
# Posted By Andy Matthews | 1/15/07 10:19 AM
Rob,

You may want to mention (unless this has changed) that the JSON serialization doesn't work with BlueDragon due to some problem with cfjson. Is this still accurate?
# Posted By Christopher Jordan | 1/15/07 11:55 AM
Chris,

JSON works fine in BlueDragon. I've tested it extensively. Remember that I found that you copy/pasted the wrong url while testing, replacing an emoticon per blank space, which is why your test failed. All the examples included in the repository were tested in BD and are working correctly.
# Posted By Rob Gonda | 1/25/07 12:21 AM
Hi Rob,

Did your latest JQuery release make it to RIAForge? I just downloaded it and the latest file was 10/31/06 - plus I couldn't find any references to JQuery.

Thanks!

Josh
# Posted By Josh Winter | 2/4/07 2:15 AM
Josh, look inside the branches folder.
# Posted By Rob Gonda | 2/4/07 12:57 PM
Hi Rob,

There is no branches folder in the RIAForge version of ajaxcfc.zip. That's why I'm thinking that they are hosting an old version of ajaxCFC.

-Josh
# Posted By Josh Winter | 2/4/07 3:59 PM
I haven't added it to the zip file download, but I added it to the SVN repository. If you have an svn client you may sync to it, or if you don't, you can scroll down, find where is says:

You may download the latest set of files from Subversion as a zip file.

and click the zip file. It points to http://ajaxcfc.riaforge.org/index.cfm?event=page.s... which will download a head version of the svn repo.
# Posted By Rob Gonda | 2/4/07 5:32 PM
Nice blog. Great news!
# Posted By May | 2/6/07 4:16 AM
I'm having the same problem on mine. I installed the newest trial of Flex 2.01, followed by cfeclipse 1.3.1.4, then followed by the extensions. Changed my workspace, and it loaded my existing coldfusion/flex application wizard app. No problems. Went into change add an additional master/details page, hit finished and then it stalled for about an hour. Forced restart. Then when i reloaded i got a funky error message in my Problems box saying: configuration variable 'compiler.context-root' must only be set once. Redid my changes in the wizard again, and saved changes just fine. Ran app even with error... no problems. But then.... went into my preferences and set up my RDS so it wouldn't ask me for my password (applied, no problems there), clicked on CFeclipse to see my options and got another funky message: Unable to create the selected preference page "org.cfeclipse.cfml.preferences.CFMLPreferencePage". Once this happened i now see 2 CFEclipse in my Find/Install wizard of which i cannot delete either one. Not only that but i can't even disable them cuz i tried to install version 1.3 just to see if that would go. No Dice! But the real kicker now that is hurting me is that when i go into my CF/Flex wizard and try to alter my project i get no response when i try to create/edit of my items. I can add them to the navigation but i can't get into the actual query browser that provides all the DB options. I"m working on finishing up a huge project that is completely generated by this wizard. Can anyone help?
Thanks in advance.


_____________________________________________________
Johnny (iron candle holder - http://fixturesandfurnitures.com/candle-holder.htm... )
# Posted By Johnny | 1/27/08 11:42 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.