Friday, November 17, 2006
There are a few good guides already on the internet that provide an overview of what is required to convert your Atlas CTP projects to Ajax Extensions. This guide is intended to consolidate some of the advice already provided, as well as offer a few pointers alluded to by others but not explained. In other words, this is the guide I wish I had before I began my own conversion project.
posted by J Ashley on Friday, November 17, 2006 5:28:37 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
To create dropzones using JavaScript instead of declarative script, just add the following JavaScript function to initialize your dropzone element with the custom dropzone behavior...
posted by J Ashley on Friday, November 17, 2006 12:36:11 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
Being able to drag html elements around a page and have them stay where you leave them is visually interesting. To make this behavior truly useful, though, an event should be thrown when the drop occurs. Furthermore, the event that is thrown should depend on where the drop occurs. In other words, there needs to be behavior that can be added to a given html element that will turn it into a "dropzone" or a "drop target", the same way that the floating behavior can be added to an html div tag to turn it into a drag and drop element. In the following examples, I will show how Atlas supports the concept of dropzones.
posted by J Ashley on Friday, November 17, 2006 12:14:45 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]
Since the declarative model is much cleaner than the imperative model, why would you ever want to write your own javascript to handle Ajax Extensions behaviors? You might want to roll your own javascript if you want to add behaviors dynamically. One limitation of the declarative model is that you can only work with objects that are initially on the page. If you start adding objects to the page dynamically, you cannot add the floating behavior to them using the declarative model. With the imperative model, on the other hand, you can.
posted by J Ashley on Friday, November 17, 2006 11:56:44 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]
To accomplish the same thing using a programmatic model requires a bit more code, but not much more. It is important to understand that when you add an Ajax Extensions Script Manager component to your page, you are actually giving instructions to have the Ajax Extensions javascript library loaded into your page. The Ajax Extensions library, among other things, provides client-side classes that extend the DOM and provide you with tools that allow you to code in a browser agnostic manner (though there currently are still issues with Safari compatibility). These client-side classes also allow you to add behaviors to your html elements.
posted by J Ashley on Friday, November 17, 2006 11:48:53 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]