Article

What's New in ColdFusion 9?

Page: 1 2 3 4

Ajax Features

One of the more exciting updates to ColdFusion 8 was the addition of new Ajax components, making the power of the ExtJS and YUI JavaScript libraries available to the ColdFusion programmer via a few simple tags. Now, in ColdFusion 9, the Adobe team has upped the ante, upgrading all of the libraries (including bringing ExtJS from version 1.0 to 3.0), which brings a number of enhancements across the board.

In particular, the datagrid and accordion components have been updated, and new components include a multiple file upload tool, a progress indicator widget, a media player control, and a Google Maps widget.

At its simplest, the multiple file upload component created with the new cffileupload tag requires only the url attribute, which specifies the processing script that will handle the file upload on the server:

<cffileupload url="ProcessFiles.cfm">

Below, you’ll see how that upload component appears.

Multiple file upload tool

There are many configuration options available, including limiting the size, maximum number, and type of files to be uploaded, as well as the button labels, size, and color of the component.

The new cfmediaplayer tag plays video files in the now ubiquitous Flash video format (.flv). Again, a very simple implementation needs only one parameter: the location of the file to play:

<cfmediaplayer source="sample.flv">

Configuration options include height, width, the ability to define borders and a background color, choice to display video controls and allowing the video to be played full screen, and even JavaScript functions to be triggered on load, on start, and on complete. Here’s how a basic media player appears:

Media player

One very useful Ajax component is the new cfmap widget, which embeds a Google map. The Google Maps API key for the domain can be specified either in the ColdFusion Administrator, in the site’s Application.cfc file, or imported at runtime via the cfajaximport tag. It’s as easy as this:

<cfajaximport params="#{googlemapkey='YOUR API KEY'}#">    
<cfmap centeraddress="345 Park Avenue, San Jose, CA, USA" zoomlevel="8"></cfmap>    

This produces the following map:

A Google map

You’ll notice cfmap has an opening and closing tag. Inside the tag pair, you can place cfmapitem tags to represent other items. Let’s add one to point out Adobe’s head office:

<cfajaximport params="#{googlemapkey='YOUR API KEY'}#">    
<cfmap centeraddress="San Jose, CA, USA" zoomlevel="6">    
 <cfmapitem name="marker01"    
  address="345 Park Avenue, San Jose, CA, USA"    
  tip="Adobe's Head Office"/>    
</cfmap>

Now, your map will display the additional marker, as shown below:

A map with markers

Altogether, the preview release of ColdFusion promises to be a highly interesting piece of technology for web developers. There are so many more new features and improvements to the product that we found it impossible to discuss each in detail, or even mention them all here, but you’ll find plenty of information about ColdFusion 9 in the new Administrator’s Guide and CFML reference documentation. The ColdFusion 9 and ColdFusion Builder betas are available, too—now’s the time to start work!

ColdFusion 9’s packed with new features and improvements. Test your knowledge of what’s inside the new ColdFusion with our quiz! Don’t forget, the first 200 participants who fill in their details will receive a shiny new ColdFusion evangelist’s kit—perfect for convincing your boss to give ColdFusion a try!

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Rate This Article

  • 1
    Poor
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
    Great

Comment on This Article

Have something to say?

Post A Comment

You need to be a member of the SitePoint Forums to comment on this post. Sign Up

Already a member? Post using your SitePoint Forums account: