Use cfajaximport to help with CF8 to CF9 migration

ColdFusion 8, ColdFusion 9

This came up in Raymond Camden's CFUnited presentation this morning and he suggested I blog it so here it is.

Problem:

You have extended the cfajax tags by calling the extJS functionality directly.  CF8 uses extJS 1.1 whereas CF9 is going to use extJS 3.0.  There will be cases it appears where this will break your code as some features have changed from the 1.1 to 3.0 release.

Solution:

  1. Copy the needed JavaScript files (from /cfide/scripts/ajax/*) to another folder in the webroot (say /cfExtJS11/ajax/) and make sure you keep the folder structure.
  2. On the top of any pages where you the cfajax tags use the cfajaximport tag:

    <cfajaximport scriptSrc="/cfExtJS11">

(Edit 10/14: I made a minor change to item 1 for clarification)

Henry Ho said:
 
is CFAJAXPROXY in CF9 backward compatible with CF8 without using this CFAJAXIMPORT tag?
 
posted 98 days ago
Add Comment Reply to: this comment OR this thread
 
samfarmer said:
 
I think all the tags will be fine unless you have written something to extend the extJS libraries.
 
posted 98 days ago
Add Comment Reply to: this comment OR this thread
 
David Mineer said:
 
Sam,

Seems to still be a problem even with the final release. Just upgraded to cf9 and our tabbed layouts are broken. Is this blog post still what you use?
 
posted 38 days ago
View Replies (1) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
samfarmer said:
 
@David: Yes, this is what I would use.
 
posted 37 days ago
Add Comment Reply to: this comment OR this thread
 
David Mineer said:
 
I tried this. Copied that folder to a folder on my server, created a mapping to it. But when I do the cfajaximport i get the coldfusion undefined error and it not only doesn't work but messes up a cfmenu that is also on the page. Did I follow the correct procedure?
 
posted 37 days ago
Add Comment Reply to: this comment OR this thread
 
samfarmer said:
 
@David: The folder you create needs to be web accessible. (Mappings won't help in this instance).

In my example cfExtJS11 would be at the webroot/cfExtJS11
 
posted 37 days ago
Add Comment Reply to: this comment OR this thread
 
David Mineer said:
 
I moved it to my webroot, removed the mapping and I get the same result. I am using modelglue so maybe that messes it up. This is so frustrating, pretty big problem to leave unfixed in final release. Thanks for your help. Do you have any other ideas?
 
posted 37 days ago
View Replies (1) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
samfarmer said:
 
@David: I don't get an error but a few things to check 1) is your cfajaximport call at the top of the page? 2) within the /cfExtJS11 folder the scripts should go in an "ajax" folder
 
posted 37 days ago
Add Comment Reply to: this comment OR this thread
 
David Mineer said:
 
Thank you for helping with this. The part I was missing, and I swear I tried it, but probably while I was still using the mapping, was the ajax folder. I had everything under the cfExtJS11 folder. Once I added the ajax folder underneath the cfExtJS11 folder then everything else under that, the errors went away and it no longer messed up cfmenu. But it didn't work either. It was different, but still blank.

The thing that does work, sort of, is to add a height value in the cflayout tag. This of course is static and if your content is too long you get another set of scrollbars other than your browser scroll bars. And if your content is too long, you have empty space at the bottom.

This will get me by, but I really hope Adobe fixes it shortly.

Sam, thanks again for the post and help.
 
posted 37 days ago
View Replies (2) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
Charley said:
 
David, I'm having the same problem. Completely replaced the scripts folder with a CF8 install and everything *sort of* works. It breaks the tabs, the windows get a little funky, but its clearly *trying* to use the old scripts. What was Adobe thinking introducing an entirely new library with no easy (and yet to be determine) way of being backwards compatible?
 
posted 31 days ago
Add Comment Reply to: this comment OR this thread
 
Cyrill said:
 
"What was Adobe thinking introducing an entirely new library with no easy (and yet to be determine) way of being backwards compatible?"
Adobe was not introduceing an entirely new library. All they did is upgrading to the latest Version of the ext.js framework.
The problem is, that the ext team decided to reengineer the entire box-model for the ui-components between ext 1.1 and ext 2.0. Since they did not take much care on backward compatibility, we are in this mess now (especially when you have built some custom components on top of ext as we did)...

In order to be able to continue the main development line and upgrade our custom libraries, I just installed CF9 beside CF8 which is possible without any major problem (all you need is do skip creating webserver connectors during install and use separate root directories).
Afterwards I set up a distinguished site for cf9 (which uses the same home directory as the original one), adding "cf9." to the domain (eg. "cf9.development.local")...
Regards, Cyrill
 
posted 16 days ago
Add Comment Reply to: this comment OR this thread
 

Search

Twitter
You should follow me on Twitter here
About Me
I am a 34-year old Web Developer specializing in ColdFusion. I live and work in downtown Washington, DC with my wife and two daughters. Read more About Me

2007 CFeMmy Best Newcommer winner
As voted on by fellow CF Bloggers.
CFinNC - Carolina ColdFusion / Flex / Air Conference - Oct 17-18, 2009