CFUnited - Advanced AJAX Development - Rakshith N
I went to another CF8 session with Rakshith N who was covering some of the new AJAX features.
CF8 now has an easy way to handle JSON. JSON is Javascript Object Notation and represents the data in Javascript. Based on array and object literals. It is less heavy than XML.
{isbn:'00230', title:'xyz'}
{isbn:'00231', title:'abc'}
}
CF8 has new functions to deal with JSON
- SerializeJSON()
- DeserializeJSON()
- IsJSON()
When CF8 creates the JS data types, simple types remain as simple types, Arrays and Structs get converted to JS arrays and JS Structs.
There are two different formats of Query, Row format and Column format.
AJAX Plumbing
Essentially when we use AJAX some area of the page will be updated by a call to the server from a Javascript program. There is some HTML markup for the area of the page we want to update. We can now define an AJAX region with a cfdiv tag. cfdiv uses the bind parameter to link to a cfc or cfm page that will be called to create the content for that area of the page.
OR
<cfdiv bind ="cfc:bookData.getBookDetails({bookForm.isbn.value@change})">
There are four types of bind
- CFC
- Javascript
- URL
- Plain
A new cfajaxproxy tag will create a JS proxy for a cfc method, allowing you to call the cfc from within javascript.
A ColdFusion object in the client JS code can be used to get information from ColdFusion. For example you can use "ColdFusion.navigate" on a link to make it download a JSON object from the server.
Other examples:
ColdFusion.log.dump(message.component)
In addition there are now AJAX versions of the tree and grid controls which can replace the Java versions in earlier CF.
There are tags to do layout like the flash form layout tags.
<cflayoutarea >


There are no comments for this entry.
[Add Comment]