ColdFusion Sneak Peak
So I just sat through the ColdFusion sneak peak at MAX, and it was done really fast, so forgive me if I get a few details wrong. The demo involved moving from a CF-based Ajax app to an AIR application. If I saw right, he began by adding a <cfairaccess& tag, and then set a property to CFGRID to mark it as available offline. He views the page in the browser and saves the result as an HTML file. He then uses the normal AIR compiling tools (from what I can tell) to generate an AIR app. It works. Ok - no big surprise there since CF generates HTML, but it is kind of nice as he is now browsing his data in the AIR app.
He then demonstrates how he could add two buttons to set the application in online/offline mode. He showed how the old code uses ColdFusion.Ajax.submitFormat and switched it to ColdFusion.air.submitForm(). He did the trick of save as/AIR compile again and this time the result application was able to detect when the application was offline. He could send mail in offline mode - go online - and see it processed.
It was rather quick and I'm missing a few details (Adobe, consider this your invitation to add details ;) but was really interesting!
Comments
This is about pushing AIR also... it would be a shame to let standard dev cycles trump market opportunities! (IMO)
The bigger issue is the need for more robust libraries. Adobe needs to let us create "plugin" form and web object libraries. (Perhaps I am just thrilled wiht CFTags again building COOP... but this could be done so easy.) They also NEED to add setting mappings at application level rather than just at the top of the page if at all possible. Mapping that is in the scheme of CFImport.
<cfimport prefix="myPrefix" ...>
<myPrefix:myTag ...>
Mapped prefixes. When you map CFC directories that is fine. You could use CFModule... but that is the ugliest way to write code! And CFModule doesn't behave strictly identical to calling the code as <cf_myTag ...> would work. Using the prefix is more elegant and the way to go.
Now... please tell me that I am wrong and you can use a prefix set in application.cfc and dinner will be on me. (Something slightly better than Burger King... but it's a meal just the same!)
First off, you are wrong. cfmodule acts the same as cf_mytag. There is zero difference.
As for it being more elegant, yes, cf_mytag is shorter, but I use cfmodule for most of my code so it is more portable. For cf8 though I plan to revert back to cf_mytag.
Now - if you are asking about being able to do cfimport in app.cfc - no - you can't. cfimports must be on the page that uses them.
1. If you use custom tag paths the first time that tag is found it will run the tag. This is only an issue if you like a member of our user group had someone else on the same shared hosting server with an older version of the same custom tag. (Not to mention that with multiple custom tag paths you could actually do it on your own server also.) This would not happen with CFModule.
2. Before CF8 you had an issue that the "name" attribute was the name of the custom tag. This means that you could not pass the name attribute to a CFModule request as an attribute. Name is actually a pretty common attribute.
So... you are mostly right. I used to use CFModule also. But as a matter of "personal taste" the tag library approach is just the way for me to go. I think the elegant code would catch on fast IF it were something we can set at the application level.
Curiosity... why are you reverting to the original custom tag syntax? I would like to glean any perspective you have on the topic.
2) Ok, not being able to use name is one small point. What I do normally in tags that desire a name attribute is to add a copy, like fooname, so my custom tag can take either.
3) I can return to cf_ syntax since cf8 will let you specifically say where my custom tag paths are.
I also agree this is a minor step that has to be repeated for every page by including CFImport calls. It would be great if we could append this functionality to being an application level tag library. Otherwise on a controlled server the CF_ method is the simplest. I am just paranoid about process integrity where the solutions get deployed on shared hosting severs also.
I remember seeing this at MAX 2007, just not sure if it was in a session or a keynote.
cfinput type="submit" validate="submitOnce" name="sub" id="sub" value="Submit Once"


Was there any word on when would this be available?