CFUnited - Andy Powell - Spry And ColdFusion Integration
Posted By : todd sharp Posted At : June 27, 2007 2:00 PM Posted In: CFUnited 2007, ColdFusion
0
As a last minute decision I decided to skip Ray's CFC session and attend Andy Powell's session on Spry/ColdFusion integration. Andy's session was divided into four different points:
What is Spry and how does it work.
- Adobe's framework for AJAX (AJAX made easy).
- Currently in pre-release 1.5
- Emphasizes simple HTML markup with minimal JavaScript
What makes Spry tick? Datasets
- XML - Data is an XML document.
- JSON - Data is a JSON formatted string.
- Tab Navs, Accordions, Panels
- Visual Enhancements (Shake, distort)
How does Spry work? Spry JS data and effects libraries are included in the page.
Benefits of using Spry? Dynamic manipulation of data without using page refreshes. Advanced user interfaces with minimal JavaScript. It's easy.
Creating and loading XML datasets:
- URL of XML (static or dynamic)
- XPath to the data.
- Optional (caching, reload intervals)
Creating and loading JSON datasets:
Displaying and using datasets:
<div spry:repeat="datasetName">
{datasetName::column}
</div>
</div>
Other dataset object functionality. Sorting - datasetName.sort("columnName"). Filtering (non-destructive & destructive). State awareness (loading, error, ready).
Integration with CF: How can we use CF with Spry? Building XML with ColdFusion (make your database do the work - have SQL return a query as XML). Build JSON with ColdFusion (native in CF 8). Use cfcontent to set the MIME type.
Whats new in CF8? CF 8 brings a strong focus on AJAX to CFML. Provides both tags and functions to aid AJAX development in general. New functions: serializeJSON(), deserializeJSON(), isJSON(). New tag cfsprydataset. cfsprydataset uses bind attribute like many other AJAX features in CF 8.


