Rob Gonda's Blog

ajaxCFC update for DRWUtil.AddRows

A recent message in the ajaxCFC group asked about the DRWUtil.addRows() function; the truth is that I had never used it. I include the utils library because there are other elements that I find useful, but I had never given the addRows a try.

Enough said, since I include the file, I guess I need to support the built-in functionality, but the addRows out-of-the-box was accepting arrays and objects. I serialize the ColdFusion queries into a more complex object which was not recognized by the addRows function, so I modified it to add wddx support. When you pass a wddx object to addRows it will now automatically populate your table, even without the need to cell functions (like the array or object methods).

You can find an example here, and download the latest release (0.63) with the code changes, example, and updated documentation from the projects page.

I'd like to thank again Joe Walker for his great effort in putting DRW together, and I will email him the changes to add wddx support for his next release.

ajaxCFC port for the Model-Glue Framework

The latest fad in the Model-Glue list has been AJAX. How to incorporate Ajax requests to the Model-Glue framework. Is it pointing directly to the model? To the controller? or going thru the full cycle by pointing to index, then controller, model, back to the controller, and passing arguments back to the view?

I ported ajaxCFC to work with Model-Glue and it came out great. It works just like any other MG event, where you have to define it in the config.xml, create a listener, use the controller, models, and views... it's beautiful. All ajaxCFC's add-ons like security and debugging work file. Request batch, complex objects, verbs, and sync requests possibilities still apply.

You can see it in action here. To make this example work you need to download the head revision from the Model-Glue framework. The only reason why the stable release would not work is that you cannot suppress debugging in a template-per-template basis.

I added the MG-echo example in the main ajaxCFC download, which also includes a modified version of ajax.cfc and engine.js. I will try to combine the stand-alone version with the MG one in the future, but for now, I will support both of them separately.

Enjoy.

Short VOD interview on AJAX

I met Jeremy Geelan last week in NY for the 1st RIA power panel and a short 1-on-1 interview. I provide a brief take on RIAs, AJAX, and where this going is. I have to admit I was a little tense in the panel as you will note, but it was a great experience that I sure hope to repeat again in the furute.

ajaxCFC: addressing html code in application.cfc

I just got hit with an email informing me that ajaxCFC will break when application.cfc adds code onRequest(start|end). I modified the framework to reset the content before the JavaScript response, and abort it at the end of the asynchronous call. I am not quite happy with the abort though, so if someone has a better solution to eliminate all code generated by onRequestEnd please comment it here. I tried to open a JS comment segment, but then it results on unfinished comment; setting enable cfoutput only will only work if the code in application doesn't use cfoutput; cfsilent needs an ending tag.

The abort works for most of the cases; the AJAX request will always work, but if you had some custom code in your onRequestEnd, such as logging, it will not be executed.

Note on application.cfc: as a general rule, try to avoid using application.cfm/cfc for html rendering. It is advisable to separate your logic from the presentation layer. Application.cfc, just like any other component, is encapsulated and parameterized, and should not display html. If you successfully separate your logic from your views, you will be able to use the same architecture for presentation layers such as html, ajax, flash, flex, laslo, or mobile devices.

Adobe vs. Microsoft: death match for RIA leadership

The buzzwords du jour are AJAX, RIA, Web 2.0 ... Both Adobe and Microsoft are involved and trying their best to get market share. Abode has Flash and Flex; and AJAX is compatible with every programming language and plays really well with CF (through ajaxCFC :) ).

Microsoft has been working on Windows Presentation Foundation (WPF), previously called Avalon. This presentation layer takes an xml based declarative language called XAML (pronounced zammel), that stands for eXtensible Application Markup Language.

I knew about XAML, but the interesting part is that Microsoft went big! They are also releasing a full development application set called expression. The community technology preview just came out and it looks like a take on Abobe's Creative Suite.

I suspect what unlike XUL (pronounced zul), which is Mozilla's xml declarative language, XAML will penetrate the market thanks to Microsoft's big name. It should natively work with the .NET framework and we should soon also see a version for Mac, even though Microsoft will no longer support their IE for Macs.

If you are a new developer and want to be ahead of the game, keep an eye on Flex 2.0 and XAML. There are other technologies such as laslo, xul, ror, bindows, backspace, and dojo, that should not be overlooked either.

IT Trends for 2006

  1. RIA (Rich Internet Applications) growth: We will start seeing more and more sites using AJAX, XAML, and Flex 2.0. With the release of XAML and Windows Vista, .NET Ajax sites will start becoming more popular. Adobe's (formally Macromedia) Flex 2.0 builder will allow non-flash savvy programmers to build full Flash RIA’s using nothing but declarative XML syntax. XUL will slowly fade away. RoR will attract php programmers, but will not find its way to the Java, .Net, or CF community.
  1. AJAX Platforms IDE’s will arise, making building user interface components with back-end integration through AJAX achievable without having to program with core frameworks. This new software will do for AJAX exactly what Flex 2.0 is doing for flash: allowing visual authoring capabilities by using new IDE’s, or by building plug-ins for existing IDE’s such as Eclipse.
  1. With quick growth of SOA, Web Services, and Remote Calls, data security will start becoming an issue. A greater effort will be devoted towards encryption, authentication, and authorization.
  1. Blogging will continue to rise, but as it does, a new, smarter filtering mechanism will have to be developed. Corporate IQ cannot depend strictly on tagging and aggregators. Probability based algorithms will analyze the personal relevance of every post.
  1. Mobile applications will start getting popular. AJAX for mobiles and Flash Lite will start hiring to build full mobile RIA’s.
  1. Some 25-year-old kid will become millionaire after coming up with a way for search engines to RELIABLY index AJAX and Flash applications.
  1. By the end of the year, Wi-Max will start becoming available in mayor cities, threatening ISP’s and cellular phone providers. VoIP wireless devices will slowly replace cell phones, providing more reliable, less expensive, and more sophisticated capabilities. Blackberries will loose market share.
  1. VoIP, IMS, SIP, XMPP, and SOA will continue to grow. Web 2.0 and VoIP 2.0 will merge. Unified messaging will get more popular among corporations.
  1. People will continue paying premium for self-service and software applications will loose market share to shared services.

ajaxCFC: server side JavaScript and dynamic content

To illustrate the idea of my previous post, I just added an example that stores the JavaScript in the server side and leaves only core connectivity and UI functionality in the client side.

It uses a simple DHTML popup windows library and sends the instruction along with the content back to the callback function, which simply executes the server’s request.

This example is not a full application and is far from perfect. It has no validations, no even listeners, or any advanced functionality. It is only meant to show how to control your JavaScript code in the server instead of the client.

AJAX: server side JavaScript

I just found this post with a very interesting idea: code does not need to exist on the client beyond connection scripts; JavaScript can be sent to browser to be executed; basically, remote invoking via passing of code (aka using eval with JavaScript received from the result handler)

Just like everything else, it has its pro's and con's, but overall, I think that in a security and even lazy loading standpoint this is a great idea.

I guess it really depends if you are using AJAX as an add-on for a web application, or to build a full application. In a robust application, the 'init' call will load all those JS components that need to be persistent and leave them on memory, and all the rest of the calls can only transfer and load the needed JavaScript, thus optimizing initial loading time.

What do you think?

What Is Ajax? : 40,000+ reads

One of my articles for the CFDJ reached over 40,000 reads today. I had never imagined that it would be such a success; it seems to be one of the most read articles in the history of the CFDJ, which is a real honor. I know most of my readers have already seen it, but if you have not, please do: http://coldfusion.sys-con.com/read/138966.htm

IMO RIA's, including AJAX, Laslo, Flex 2.0, and XAML will be huge topics for 2006, so stay ahead of the competition and start doing your research now.

Btw, XAML is short for eXtensible Application Markup Language, and pronounced "Zammel".

Mozilla has its own version, but it won't go anywhere… it's called XUL, short for  User Interface Language and pronounced "zool"... XUL followers feel free to argue this statement.

script.aculo.us 1.5.1

For those of you following script.aculo.us, there’s a new version out with a bunch of bug fixes and a couple of new features added, including dynamic loading of components which allows for optimizing and fine tuning your pages according to your needs… this will help a little with loading times for dial-up users.

More Entries

This blog is running version 5.9.003. Contact Blog Owner