I am learning AIR

I have a new project at work that is a perfect candidate for an AIR application. It is an application for collecting data from hospitals around the state of Minnesota. It stores its data in a central database, but it requires the ability for our field abstracters to be able to take some of the data with them on a laptop to the hospitals, make changes to the data, and then bring it back to be synced to the central database. While in the field, the laptop cannot be connected to the central database, so it needs a local copy of the data.

I have been having a blast learning about AIR. We have opted to use AIR with HTML and Ajax (using jQuery) instead of Flex. Flex has not been approved for use here yet. That is on my list of things to do in the future.

If I get to the point where I feel like I know enough about AIR or jQuery to actually benefit anyone by blogging about it, I will, but in the meantime, I have been spending a lot of time learning about these technologies and really enjoying it. Some of the things I have been learning are:

I have come across many challenges with learning AIR already. I have done Ajax stuff before, but never to this extent. I have spent many an hour (or 4) pulling my hair out trying to understand some things. But eventually it clicks and I am happy.

I'm Looking forward to telling you more. We'll see what kind of time I have for it.

Dan Sorensen's Gravatar I'm looking forward to it. Sounds like you'll be having some fun soon. I'm currently going through a similar transition. I'm having a whole lot of fun with jQuery and working my way through AIR.
# Posted By Dan Sorensen | 3/15/09 11:47 PM
Todd Rafferty's Gravatar I'd be interested in knowing what some of the hurdles you've gone through with Air/jQuery.
# Posted By Todd Rafferty | 3/16/09 3:35 AM
Timothy Farrar's Gravatar Anyone here have success with getting the jQuery UI working with AIR?

I've not put a whole lot of time into it yet, but was messing around w/ it over the weekend, and can't seem to get the styles working from an included style sheet...

Also the jQuery(selector).addClass(myClass) I haven't been able to get working.
# Posted By Timothy Farrar | 3/16/09 6:54 AM
Jason Dean's Gravatar @Dan and @Todd, Great! I am glad to have some interest. Even if i am not an expert, there is no reason not to blog about the issues I have (and solve). Perhaps others can offer better solutions if I write about them.


I have had pretty good success working with jQuery UI and AIR. The themes seem to work pretty well, and so far all, save one, of the components have been working for me.

Unfortunately, the one component that does not work is the date picker (calendar). It will create the calendar and display it, but it is non-functional. It will open, but a date cannot be selected. I was hoping with the latest jQuery UI release that it would be fixed, but it still fails. I am not sure what causes it, my research has turned up little. My guess is that it is one of AIR's security restrictions.

I found a different calendar to use, in the meantime, though it is not as attractive. I will blog more about that in the future.


As for $(selector).addClass(): After I read that, it occurred to me that I have not tried that in AIR, so I did. At first, it seemed you were right. I created a element, and style to test it. And when I tried to use addClass() on it in document.ready(), it seemed not to work. I tried changing the styles, didn't help. I tried using a different selector format $("div[id=myDiv]").addClass() and that DID work.

So then I tried the proper selector again, but instead of trying to change the class, I tried to trigger the click handler. Worked just fine. Then I switched it back to addClass() and tried again. Suddenly, it is working as expected.

Perhaps, I had typed something the first time I tried it. But now, addClass() is working exactly as I would expect (Even adding multiple classes in one statement.
# Posted By Jason Dean | 3/16/09 9:04 AM
Dan Sorensen's Gravatar Curious: is there a reason why you use $("div[id=myDiv]") rather than $("div#myDiv") ?
# Posted By Dan Sorensen | 3/16/09 9:17 AM
Jason Dean's Gravatar It was just the first thing that sprang to mind because $("#myDiv") wasn't working.
# Posted By Jason Dean | 3/16/09 9:35 AM
Timothy Farrar's Gravatar @Jason... The Date Picker behaved the same way for me that you were describing... would you care to share the code w/ me for the addClass functionality though?
# Posted By Timothy Farrar | 3/16/09 9:42 AM
Jason Dean's Gravatar @Timothy, I have uploaded my sample AIR app with the test that I did. It is very simple (please don't expect much).

# Posted By Jason Dean | 3/16/09 9:58 AM
Timothy Farrar's Gravatar hmmm.... don't know what the difference was either... thanks for the code though... Your code worked correctly, and I got my code working now...
# Posted By Timothy Farrar | 3/16/09 10:22 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.1. Contact Blog Owner