Warning to Ajax users in ColdFusion 9

I’ve seen this come up a few times now so I thought I’d whip up a quick blog entry to help spread the word. One of the cooler aspects of ColdFusion 8’s Ajax support was that it provided hooks to the underlying frameworks. So for example, when working with CFWINDOW, if you wanted to do something that ColdFusion didn’t provide a JS API for, you would use getWindowObject to retrieve the actual Ext object. If you visited the Ext docs, you could then look for the API you wanted to use.

This worked fine - except that ColdFusion 8’s Ext library was somewhat old. ColdFusion 9 corrected this and uses the latest (well, as far as I know, maybe Ext is a minor point or two ahead now) version. This means that - potentially - any code you have that made use of the API may no longer work.

Here is an example that came in today - it uses the Grid API.

function initGrid(){ var grid = ColdFusion.Grid.getGridObject('maingrid'); var gridHead = grid.getView().getHeaderPanel(true); var tbar = new Ext.Toolbar(gridHead); ...

This worked fine under ColdFusion 8, but fails in 9. I’m not terribly familiar with the latest Ext, but I’m sure the developer could find a new way of doing what he wanted to accomplish.

Not the end of the world for sure, but something to keep in mind. In general, if I feel the need to go “off the ranch” from Adobe’s provided UI controls, I’d just end up using the library’s code by itself.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments