DevWebProSE
DevWebProSE Newsletter:
Last Updated:


Get Your Site Submitted for Free in the World's Largest B2B Directory!

Email Address:
* URL:
*
*Indicates Mandatory Field

Terms & Conditions


A Great Resource For Spry/AIR

By Raymond Camden
Expert Author
Article Date: 2007-12-18

I was very much into AIR in the past, but kind of fell behind this summer.

I'm spending some time this month getting back into it, and I've run afoul of some of the big security changes that were made. One thing to note, in particular, are issues with Spry and AIR. You can find out details here:

http://labs.adobe.com/technologies/spry/air.html

The page tells you to go look at the docs, which help a bit, but here are some concrete examples. First, I had a simple drop down bound to a dataset. I made it so that when you selected an item, it set the current row. This then fired off another dataset. Anyway, the old code was:

<select id="librarydd" name="library" onChange="libs.setCurrentRow(this.selectedIndex);">

If you read the Spry/AIR link above, you will see that this no longer works. Instead you need to use a region observer. A region observer watches changes to a div/span that is generated by Spry. So I begun by writing code to run after the drop down region was generated.

myObserver = new Object;
myObserver.onPostUpdate = function(notifier, data) {
    Spry.Utils.addEventListener("librarydd", "change", libHandler, false);
};
Spry.Data.Region.addObserver("libregion", myObserver);


This code basically says: When you are doing drawing the region, run my onPostUpdate function. That code then adds an event listener for the change event. It's bound to the library drop down and runs a function named libHandler. Finally, this function is:

function libHandler() {
   libs.setCurrentRow(this.selectedIndex);
}


So - a lot of work, but after banging my head against the wall for a few hours, it at least makes sense to me now. I hope to have my new sample code released tomorrow.

Comments

About the Author:
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy.



Newsletter Archive | Article Archive | Submit Article | Advertising Information | About Us | Contact | Site Map

DevWebProSE is an iEntry, Inc.® publication - 1998-2008 All Rights Reserved Privacy Policy and Legal