<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Objective Action - AJAX</title>
			<link>http://www.objectiveaction.com/Kevin/index.cfm</link>
			<description>An Objective Look at Adobe and the Internet</description>
			<language>en-us</language>
			<pubDate>Wed, 08 Sep 2010 13:08:55+0100</pubDate>
			<lastBuildDate>Fri, 26 Dec 2008 16:18:00+0100</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>kevin@objectiveinternet.com</managingEditor>
			<webMaster>kevin@objectiveinternet.com</webMaster>
			
			
			
			
			
			<item>
				<title>Using Ext JS 2.2 Ajax in CF - Part 4 - Color Picker and Date Picker Controls.</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2008/12/26/Using-Ext-JS-22-Ajax-in-CF--Part-4--Color-Picker-and-Date-Picker-Controls</link>
				<description>
				
				One of the big reasons for using Ext JS with ColdFusion is the ability to use the widgets to improve the user interface we present to our users. Ext JS comes aith a Date picker and a Color Picker and the &lt;a href=&quot;http://www.madfellas.com/docs/&quot; target=&quot;_blank&quot;&gt;ColdExt tags demo&lt;/a&gt; has both tantalising us in its demo pages. Unfortunately the ColdExt demos don&apos;t 
really show us how to use them in a real application. In the most simple case we might want a form to show one of these controls and for the user to be able to submit the form with the chosen date or color value.

Lets take a look at the example code for the color palette:

&lt;code&gt;
&lt;!--- all examples will be appended to this div ---&gt;
&lt;div id=&quot;progress1-out&quot; class=&quot;output&quot;&gt;&lt;/div&gt;

&lt;ext:onReady&gt;  
   
	&lt;ext:createChild tag=&quot;h2&quot; renderTo=&quot;progress1-out&quot;&gt;Color Palette&lt;/ext:createChild&gt;  
	&lt;ext:colorPalette var=&quot;myPalette&quot; renderTo=&quot;progress1-out&quot;&gt;  
....
&lt;/ext:onReady&gt;

&lt;/code&gt;

Unfortnately this code does not show how we can use the code in a form. All the Ext JS controls are based on an event model. When we add a control to page with the ColdExt tags it won&apos;t do anything unless we add some Javascript to react to the events that happen to the control.

A quick look at the &lt;a href=&quot;http://extjs.com/deploy/dev/docs/&quot; target=&quot;_blank&quot;&gt;Ext JS 2.2 API&lt;/a&gt; reveals that there are a number of events that we can create listeners for.

The one that looked most interesting for me wass the select event which fires when a color is selected and passes the control and the selected color as parameters. To make use of this we can create another control to save the value which can then be submitted by the form. In this simple case I have created an Ext textField control to save the selected value. I populate it with the color value when the user clicks on a color in the palette.

So here is my new example code whit a listener, which looks for the &apos;select&apos; event and updates the textField in the code below:

&lt;code&gt;
&lt;!--- all examples will be appended to this div ---&gt;
&lt;div id=&quot;progress1-out&quot; class=&quot;output&quot;&gt;&lt;/div&gt;

&lt;ext:onReady&gt;
	&lt;ext:createChild tag=&quot;h2&quot; renderTo=&quot;progress1-out&quot;&gt;Color Palette&lt;/ext:createChild&gt;
	&lt;ext:colorPalette var=&quot;myPalette&quot; renderTo=&quot;progress1-out&quot;&gt;
		&lt;ext:listener eventName=&quot;select&quot;&gt;
			function(control,value){
				Ext.getCmp(&quot;color&quot;).setValue(value);
			}
		&lt;/ext:listener&gt;
	&lt;/ext:colorPalette&gt;

	&lt;ext:textField id=&quot;color&quot; name=&quot;color&quot; label=&quot;Color&quot; value=&quot;&quot; renderTo=&quot;progress1-out&quot;/&gt;

....

&lt;/ext:onReady&gt;
&lt;/code&gt;

A similar piece of code can be used for the date picker:

&lt;code&gt;
&lt;ext:onReady&gt;
	&lt;ext:createChild tag=&quot;h2&quot; renderTo=&quot;progress1-out&quot;&gt;Date Picker&lt;/ext:createChild&gt;
	&lt;ext:datePicker var=&quot;myDatePicker&quot; renderTo=&quot;progress1-out&quot;&gt;
		&lt;ext:listener eventName=&quot;select&quot;&gt;
			function(control,value){
				Ext.getCmp(&quot;date&quot;).setValue(value);
			}
		&lt;/ext:listener&gt;
	&lt;/ext:datePicker&gt;
	
	&lt;ext:textField id=&quot;date&quot; name=&quot;date&quot; label=&quot;Date&quot; value=&quot;&quot; renderTo=&quot;progress1-out&quot;/&gt;

&lt;/ext:onReady&gt;
&lt;/code&gt;

Of course, in a real example, the textField would be most likely to be inside a form tag and would not then require the renderTo attribute.

I hope this has been useful to you. If so please leave a note in the comments.
				
				</description>
						
				
				<category>Ext JS</category>				
				
				<category>AJAX</category>				
				
				<pubDate>Fri, 26 Dec 2008 16:18:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2008/12/26/Using-Ext-JS-22-Ajax-in-CF--Part-4--Color-Picker-and-Date-Picker-Controls</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Using Ext JS 2.2 Ajax in CF - Part 3 - Adding new rows to the grid.</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2008/12/24/Using-Ext-JS-22-Ajax-in-CF--Part-3--Adding-new-rows-to-the-grid</link>
				<description>
				
				Welcome to my third visit into the world of Ext JS and the ColdExt tag library.

To put this post in context I have included a picture of my final grid control at the top of the page.

When I began trying to use the Ext Grid Control to edit records, one of the first problems I had to solve was how to add additional rows. I asked the question on the ColdExt forum but got no answer.

Luckilly there were lots of people who had solved the problem on the Ext JS forums before me. It took me a while to translate the Ext JS solutions into one based on ColdExt, but here is what I came up with.

Several of the Ext JS widgets make use of the Ext.Data.Store this is a general purpose way to store data on the client and can keep trach of changes in the background leaving the control to get on with the display and presentation of the data. The Store also provides ways to transfer the data to and from the server. 

One particular version of the store is JsonStore which provides a way to read and populate the store from Json data which is easy to create with ColdFusion. In the ColdExt examples Justin Carter has used a &lt;a href=&quot;http://www.epiphantastic.com/cfjson/&quot;&gt;Json library by Jehiah Czebotar and Thomas Messier&lt;/a&gt; to create the Json which is used to load the store. In his notes Justin says this is &quot;for compatibility&quot;. I know CF8 will create Json directly so I am not sure where the compatibility issue lies. It could be done to allow CF7 users to make use of the ColdExt tags or it could be because of some difference between the way CF8 creates Json and what is needed by the Ext Js widgets. Maybe someone who knows will comment.

So the first set in using the Grid as an editor is to create a suitable data store. Here is my code for that:

&lt;code&gt;
&lt;ext:jsonStore var=&quot;ObjectTypeJSON&quot; autoLoad=&quot;true&quot; remoteSort=&quot;true&quot;
			root=&quot;query.data&quot; totalProperty=&quot;totalcount&quot; url=&quot;/model/mProperty/ObjectTypeGetJson.cfm&quot;&gt;
		
	&lt;ext:field name=&quot;objecttypeid&quot; /&gt;
	&lt;ext:field name=&quot;groupid&quot; /&gt;
	&lt;ext:field name=&quot;visibilityid&quot; /&gt;
	&lt;ext:field name=&quot;managementid&quot; /&gt;
	&lt;ext:field name=&quot;title&quot; /&gt;
	&lt;ext:field name=&quot;description&quot; /&gt;
	&lt;ext:field name=&quot;allowmultiple&quot; /&gt;
	&lt;ext:field name=&quot;groupmayown&quot; /&gt;
	&lt;ext:field name=&quot;membermayown&quot; /&gt;
	&lt;ext:field name=&quot;membermayedit&quot; /&gt;
		
	&lt;ext:param name=&quot;limit&quot; value=&quot;#attributes._Maxrows#&quot; /&gt;
	&lt;ext:param name=&quot;deleted&quot; value=&quot;&quot; /&gt;
	&lt;ext:param name=&quot;selectedRow&quot; value=&quot;&quot; /&gt;
	
&lt;/ext:jsonStore&gt;
&lt;/code&gt;

The url parameter on the JsonStore tag links to my ColdFusion template that creates the Json data.

I have created fields for each of the columns I display in the grid and I also created a couple of extra param tags which I use to keep track of which row is selcted and a list of the rows which have been deleted.

The limit param is used to drive the paging toolbar which allows the user to page through a large dataset a few rows at a time without having to download all the rows to the client.

So our goal is to create a new record and display it in the grid, where the user can update it with their own data. In order to do that all that is needed is to add the new record to the store. Ext JS will take care of the rest.

To add a new record we need to first create a record template:

&lt;code&gt;

	// Create a record type to allow new ones to be created.
	var ObjectType = Ext.data.Record.create([
		{name: &apos;objecttypeid&apos;, type: &apos;number&apos;},
		{name: &apos;groupid&apos;, type: &apos;number&apos;},
		{name: &apos;visibilityid&apos;, type: &apos;number&apos;},
		{name: &apos;managementid&apos;, type: &apos;number&apos;},
		{name: &apos;title&apos;, type: &apos;string&apos;},
		{name: &apos;description&apos;, type: &apos;string&apos;},
		{name: &apos;allowmultiple&apos;, type: &apos;bool&apos;},
		{name: &apos;groupmayown&apos;, type: &apos;bool&apos;},
		{name: &apos;membermayown&apos;, type: &apos;bool&apos;},
		{name: &apos;membermayedit&apos;, type: &apos;bool&apos;}
		
	]);

&lt;/code&gt;

When we have a tempate for a record we can create one:

&lt;code&gt;	
	// Create a new empty record.
	var newRec = new ObjectType({
		objecttypeid: 0,
		groupid: #attributes.grou_select#,
		visibilityid: 5,
		managementid: 5,
		title: &apos;&apos;,
		description: &apos;&apos;,
		allowmultiple: true,
		groupmayown: false,
		membermayown: true,
		membermayedit: true
	});

&lt;/code&gt;

Finally we add the record to the store:

&lt;code&gt;
	// Turn editing off and add the record.
	myGrid.stopEditing();
	myGrid.getStore().insert(0, newRec);
	myGrid.startEditing(0, 0);
	
&lt;/code&gt;

In order to use the above code in a coldExt control we simply have to specify it as the handler for the button on the toolbar. We wrap the handler code in a pair of handler tags.

&lt;code&gt;

&lt;ext:handler name=&quot;addNew&quot;&gt;&lt;/ext:handler&gt;

&lt;/code&gt;
Finally we link the code to the button on the toolbar:

&lt;code&gt;
&lt;ext:toolbarButton text=&quot;Add New&quot; iconCls=&quot;icon-add&quot; handler=&quot;addNew&quot; /&gt;

&lt;/code&gt;

Well I hope that is some use to someone. Please let me know if it helps you.
				
				</description>
						
				
				<category>Ext JS</category>				
				
				<category>AJAX</category>				
				
				<pubDate>Wed, 24 Dec 2008 16:49:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2008/12/24/Using-Ext-JS-22-Ajax-in-CF--Part-3--Adding-new-rows-to-the-grid</guid>
				
				<enclosure url="http://www.objectiveaction.com/Kevin/enclosures/ExtGridExample.png" length="7366" type="image/png"/>
				
			</item>
			
		 	
			
			
			<item>
				<title>Using Ext JS 2.2 Ajax in CF - Part 2 - Combo boxes in the grid.</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2008/12/19/Using-Ext-JS-22-Ajax-in-CF--Part-2--Combo-boxes-in-the-grid</link>
				<description>
				
				The real reason I started looking at Ext was my frustration with the Ext based grid control in ColdFusion 8. As I mentioned in &lt;a href=&quot;/index.cfm/2008/12/17/Using-Ext-JS-22-Ajax-in-CF--Part-1--Coldext-plus-Combo-box-Id-and-Value&quot;&gt;the previous post&lt;/a&gt;, I have never had much sucess with the &amp;lt;cfgrid&amp;gt; tag. It seems to offer so much but deliver so little. When it comes down to the final page its always gone in favour of somthing much more clunky but which actually works. 

Flush with my sucess with combo boxes in an Ext form. I was convinced that I could move on to the real goal. The Ext Grid control. This seemed to offer everything I wanted. The &lt;a href=&quot;http://www.madfellas.com/docs/&quot; target=&quot;_blank&quot;&gt;examples&lt;/a&gt; showed all the needed features and with the support of the &lt;a href=&quot;http://coldext.riaforge.org/&quot; target=&quot;_blank&quot;&gt;ColdExt tags&lt;/a&gt; I showed no fear.

Well I was soon caught out by the same issue that got me earlier. How to make the combo box do what a select list does. The Ext grid has the same problem with combo boxes as regular forms. However I could not see how to make use of my earlier fix, the use of a hidden field.

There were a &lt;a href=&quot;http://extjs.com/forum/showthread.php?t=27784&quot; target=&quot;_blank&quot;&gt;number of postings&lt;/a&gt; on the &lt;a href=&quot;
http://extjs.com/forum/showthread.php?t=34691&quot; target=&quot;_blank&quot;&gt;Ext Forums&lt;/a&gt;, with various solutions, none of which appeared to work for me.

I decided to pick &lt;a href=&quot;http://extjs.com/forum/showthread.php?p=165242&quot;&gt;a forum posting by nkohari&lt;/a&gt; and worry it until I got somewhere. At first it seemed completly incompatible with the ColdExt tags, so I began with using the Javascript and not using any ColdExt tags.

What was missing from that posting took a little time to discover.

&lt;code&gt;
var store = new Ext.data.SimpleStore({
  fields: [ &quot;value&quot;, &quot;text&quot; ],
  data: [
    [ &quot;value1&quot;, &quot;Option 1&quot; ],
    [ &quot;value2&quot;, &quot;Option 2&quot; ],
    ...
  ]
});

var combo = new Ext.form.ComboBox({
  store: store,
  valueField: &quot;value&quot;,
  displayField: &quot;text&quot;,
  ...
});
&lt;/code&gt;

Its all in the ... that nkohari adds to the parameters. After a little worrying and changing things I had a working drop down but it was trying to get somthing remotely when all the data was local. Further investigation revealed that the ColdExt tags add mode: &quot;local&quot; where the ... is in the combo definition. Added that and it all worked!

When I looked at the final code I began to realise that there was a way to make most of it work using ColdExt tags.

The main issue is that the renderer has to have a combo box passed to it as a parameter so you have to define your combo boxes before you build the grid rather than inside the grid as normal.

So my final solution uses the script from nkohari to build the renderer and the rest is done with ColdExt:

&lt;code&gt;
&lt;ext:onReady&gt;
	&lt;!--- Code to fix the combo box in a grid prolem in Ext Grids ---&gt;
	&lt;ext:script&gt;
		Ext.namespace(&quot;Ext.ux&quot;);
		Ext.ux.comboBoxRenderer = function(combo) {
		  return function(value) {
		    var idx = combo.store.find(combo.valueField, value);
		    var rec = combo.store.getAt(idx);
		    return rec.get(combo.displayField);
		  };
		}
	&lt;/ext:script&gt;
	&lt;!--- Define the combo box ---&gt;
	&lt;ext:comboBox var=&quot;managementCombo&quot; valueField=&quot;value&quot; displayField=&quot;text&quot; allowBlank=&quot;false&quot; &gt;
		&lt;cfloop query=&quot;qManagement&quot;&gt;&lt;ext:option value=&quot;#qManagement.mana_id#&quot;&gt;#qManagement.mana_title#&lt;/ext:option&gt;
		&lt;/cfloop&gt;
	&lt;/ext:comboBox&gt;
&lt;/code&gt;

Inside the grid we simply use the predefined combo box and our renderer.

&lt;code&gt;
&lt;ext:gridColumn header=&quot;Editable By&quot; width=&quot;90&quot; sortable=&quot;true&quot; dataIndex=&quot;managementid&quot; hidden=&quot;#hide#&quot;
									renderer=&quot;Ext.ux.comboBoxRenderer(managementCombo)&quot; editor=&quot;managementCombo&quot; /&gt;
&lt;/code&gt;


I hope that helps someone else use the Ext Grid without the hassle I had. Please let me know if it helps you.
				
				</description>
						
				
				<category>Ext JS</category>				
				
				<category>AJAX</category>				
				
				<pubDate>Fri, 19 Dec 2008 10:07:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2008/12/19/Using-Ext-JS-22-Ajax-in-CF--Part-2--Combo-boxes-in-the-grid</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Using Ext JS 2.2 Ajax in CF - Part 1 - Coldext plus Combo box Id and Value</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2008/12/17/Using-Ext-JS-22-Ajax-in-CF--Part-1--Coldext-plus-Combo-box-Id-and-Value</link>
				<description>
				
				Over the last couple of weeks I have been playing with a new Ajax library. New? Well its been around a while but it is new to me.

The reason for my interest was the frustration I had with using the grid in ColdFusion. The cfgrid tag is very appealing but every time I tried to use it, something I needed did not work quite well enough or quite the way I wanted in order to make it suitable for the application. It has always been very frustrating. The latest CF8 implementation is no better. I realised that the thing I was working on would be best done with some kind of grid. I started with a cfgrid tag and soon realised that my idea would not quite work.

Then I remembered that the latest CF8 HTML grid uses Ext 1.0 as its underlying engine. I took a quick look at the &lt;a 
href=&quot;http://extjs.com/&quot; target=&quot;_blank&quot;&gt;Ext web site&lt;/a&gt; and the &lt;a href=&quot;http://extjs.com/deploy/dev/examples/samples.html&quot; target=&quot;_blank&quot;&gt;grid demo&lt;/a&gt;.

When I tried the samples I saw immediately that the latest version of Ext would do what I needed. Basicly I wanted to be able to easily page through a number of records and the examples had a way of adding a paging toolbar and a toolbar with icons for save and refresh and so on.

The only problem for me was that my exiting application code was using some other ColdFusion features that were based on Ext. I realised that using two different versions of Ext together would impossible so I had to replace all the existing easy to use CF tab based stuff with Ext code which is based on Javascript. It was do-able but not vey nice.

Luckily before I began the job I thought to check RIAforge and found that Justin Carter had created a &lt;a href=&quot;http://coldext.riaforge.org/&quot; target=&quot;_blank&quot;&gt;series of CF custom tags&lt;/a&gt; to support the Ext 2.2 libary. Basicly each tag exacly mimics the JS call so that you can write a CF tag instead of the JS code.

For me this made the conversion much easier. No need to reformat everything just change some of the tags to call Justin&apos;s tags and it worked! A big thank you to Justin for the tag library.

Since then I have come across some issues with the way Ext JS things work and found work arounds. Some of them are not quite sraightforward, I decided to document my solutions so that anyone else who wants can avoid going through the hassle.

So here is my first contribution....

&lt;h2&gt;Combo box Id and Value&lt;/h2&gt;

At first sight the Ext JS combo box seems to be exacly like an HTML select. There is a dropdown list, you can choose somthing from the list and it gets displayed. Simple? Wrong!

The combo box is actually a more complex control and although it can look a bit like a select it is actually a completely new beast to those who have grown up using HTML. In the default mode the combo box does one major thing that the select does not and that is it allows you to type a new thing into the box that is not just one of the items in the drop down. This is the key to the reson why it does not work like a select control. 

While the select control allows you to choose a value and  returns the id associated with that value the combo can&apos;t quite do that. Because you can type somthing it has to return what is displayed. After all it might just be something not actually in the dropdown list.

You can set the contol so that it does not allow typing by setting a parameter, (editable=&quot;false&quot;), but that won&apos;t make the control return the id rather than the value. On the Ext Js web site there are some complex solutions offered with cuson renderers for the combo box, but somehow they don&apos;t feel easy to implement.

What I decided to do was to create a hidden control and use that for the id. When someone updates the choice, a change event can be used to update the hidden contol. Here is an example written using the coldext tags.

&lt;code&gt;

&lt;ext:comboBox name=&quot;naxg_marketing_text&quot; label=&quot;Enquiry Source&quot; value=&quot;#attributes.naxg_marketing#&quot; emptyText=&quot;Select an Enquiry Source...&quot; allowBlank=&quot;false&quot; editable=&quot;false&quot;&gt;
	&lt;cfloop query=&quot;qMarketing&quot;&gt;&lt;ext:option value=&quot;#qMarketing.sour_id#&quot;&gt;#qMarketing.sour_title#&lt;/ext:option&gt;
	&lt;/cfloop&gt;
	&lt;ext:listener eventName=&quot;change&quot;&gt;
				function(control,newValue,oldvalue){
			Ext.getCmp(&quot;naxg_marketing&quot;).setValue(newValue);
				}
	&lt;/ext:listener&gt;
&lt;/ext:comboBox&gt;
&lt;ext:hidden id=&quot;naxg_marketing&quot; name=&quot;naxg_marketing&quot; value=&quot;#attributes.naxg_marketing#&quot; /&gt;
					
&lt;/code&gt;

I hope you find it useful. Please let me know if you do.
				
				</description>
						
				
				<category>Ext JS</category>				
				
				<category>AJAX</category>				
				
				<pubDate>Wed, 17 Dec 2008 13:21:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2008/12/17/Using-Ext-JS-22-Ajax-in-CF--Part-1--Coldext-plus-Combo-box-Id-and-Value</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>AJAX - A battle between Spry and CF8 built in facilities</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2008/1/13/AJAX--A-battle-between-Spry-and-CF8-built-in-facilities</link>
				<description>
				
				I have been working on a new project which requires AJAX functionality and unlike some projects have some more time available to try out alternate ideas. The result has been interesting, so I thought I would share it.

There are a number of pieces of funcionality planned and in almost every case there has been a choice of using a CF function or a Spry equivalent and I have come down in favour of the Spry equivalent.
				 [More]
				</description>
						
				
				<category>ColdFusion</category>				
				
				<category>AJAX</category>				
				
				<category>Spry</category>				
				
				<pubDate>Sun, 13 Jan 2008 10:06:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2008/1/13/AJAX--A-battle-between-Spry-and-CF8-built-in-facilities</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Setting a Select Control from a spry dataset.</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2007/11/21/Setting-a-Select-Control-from-a-spry-dataset</link>
				<description>
				
				I have been playing with Adobe&apos;s Spry AJAX framework and am most impressed by the Spry Dataset. It really gives Spry a big plus over some of the other frameworks since it makes handling data from databases much easier.

One thing that I needed was missing, an easy way to set a select control based on the dataset. It wan&apos;t however very difficult to do that when I tried. To save you wading though the docs to find it here is how I managed it.
				 [More]
				</description>
						
				
				<category>AJAX</category>				
				
				<category>Spry</category>				
				
				<pubDate>Wed, 21 Nov 2007 09:08:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2007/11/21/Setting-a-Select-Control-from-a-spry-dataset</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>New Books from Peachpit and new sitepoint Blog about CF</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2007/10/19/New-Books-from-Peachpit-and-new-sitepoint-Blog-about-CF</link>
				<description>
				
				I had a note yesterday from Jackie Hill of Peachpit with details of a some new books that they are releasing this month.

Ben Forta&apos;s bestselling ColdFusion book has been updated for version 8, Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started. May well be of interest to my readers. I checked on Amazon and they also have Volume 2 and Volume 3 of the book affectionately known as CFWACK. I have posted links to all three volumes in the right hand menu bar.

With so much new stuff in CF8, Ben has had to split the book into three volumes. The pricing is also interesting since Volume 1 is way less than the other two. Maybe Adobe are getting the point that there needs to be a better path into CF for beginners.

On publicising CF. I see that Kay Smoljak is going to be &lt;a href=&quot;http://www.sitepoint.com/blogs/2007/10/15/coldfusion-myth-busting/&quot; target=&quot;_blank&quot;&gt;blogging about ColdFusion&lt;/a&gt; at SitePoint. They regularly feature interesting articles about web site development and I often read with interest the articles on
&lt;a href=&quot;http://www.sitepoint.com/article/simply-javascript&quot; target=&quot;_blank&quot;&gt;Javascript&lt;/a&gt;,
&lt;a href=&quot;http://www.sitepoint.com/article/ajax-jquery&quot; target=&quot;_blank&quot;&gt;AJAX&lt;/a&gt;,
&lt;a href=&quot;http://www.sitepoint.com/article/most-common-seo-mistakes&quot; target=&quot;_blank&quot;&gt;Search Engine Optimisation&lt;/a&gt; and
&lt;a href=&quot;http://www.sitepoint.com/article/fancy-form-design-css&quot; target=&quot;_blank&quot;&gt;CSS&lt;/a&gt; issues.
				
				</description>
						
				
				<category>ColdFusion</category>				
				
				<category>AJAX</category>				
				
				<category>CSS</category>				
				
				<pubDate>Fri, 19 Oct 2007 14:47:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2007/10/19/New-Books-from-Peachpit-and-new-sitepoint-Blog-about-CF</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>CFUnited - Advanced AJAX Development - Rakshith N</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2007/6/30/CFUnited--Advanced-AJAX-Development--Rakshith-N</link>
				<description>
				
				I went to another CF8 session with &lt;a href=&quot;http://www.rakshith.net/blog/&quot; target=&quot;_blank&quot;&gt;Rakshith N&lt;/a&gt; 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.

&lt;code&gt;
{ books:[
{isbn:&apos;00230&apos;, title:&apos;xyz&apos;}
{isbn:&apos;00231&apos;, title:&apos;abc&apos;}
}
&lt;/code&gt;

CF8 has new functions to deal with JSON 
&lt;ul&gt;
&lt;li&gt;SerializeJSON()&lt;/li&gt;
&lt;li&gt;DeserializeJSON()&lt;/li&gt;
&lt;li&gt;IsJSON()&lt;/li&gt;
&lt;/ul&gt;

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.

&lt;h4&gt;AJAX Plumbing&lt;/h4&gt;

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.
 
&lt;code&gt;
&lt;cfdiv bind =&quot;url:foo.cfm&quot;&gt;
OR
&lt;cfdiv bind =&quot;cfc:bookData.getBookDetails({bookForm.isbn.value@change})&quot;&gt;
&lt;/code&gt;

There are four types of bind
&lt;ul&gt;
&lt;li&gt;CFC&lt;/li&gt;
&lt;li&gt;Javascript&lt;/li&gt;
&lt;li&gt;URL&lt;/li&gt;
&lt;li&gt;Plain&lt;/li&gt;
&lt;/ul&gt;

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 &quot;ColdFusion.navigate&quot; on a link to make it download a JSON object from the server. 

Other examples:

&lt;code&gt;
ColdFusion.Ajax.submitForm(fomnId, url, callBasckHandler, errorHandler, httpMethod, asynch)

ColdFusion.log.dump(message.component)
&lt;/code&gt;

In addition there are now AJAX versions of the tree and grid controls which can replace the Java versions in earlier CF.

&lt;code&gt;
&lt;cftree name=&quot;mail&quot; format=&quot;html&quot; completepath=&quot;true&quot;&gt;
&lt;/code&gt;

There are tags to do layout like the flash form layout tags.

&lt;code&gt;
&lt;cflayout type=&quot;border&quot;&gt;

&lt;cflayoutarea &gt;
&lt;/code&gt;
				
				</description>
						
				
				<category>ColdFusion</category>				
				
				<category>Conferences</category>				
				
				<category>AJAX</category>				
				
				<category>Scorpio</category>				
				
				<pubDate>Sat, 30 Jun 2007 14:21:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2007/6/30/CFUnited--Advanced-AJAX-Development--Rakshith-N</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>FlexManiacs - Day 2 - Mike Sundermeyer and Tom Hobbs - Adobe Experience Design</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2007/6/26/FlexManiacs--Day-2--Mike-Sundermeyer-and-Tom-Hobbs--Adobe-Experience-Design</link>
				<description>
				
				The XD Team is working with companies who want to push the envelope. Including RIAs and Mobile phone interfaces in Flash and Flex. Now working on new Flex components.

Mike and Tom outlined a typical scenario involving the development of page wireframes, then graphic design, then code in Flex or HTML. They then showed a series of new techniques and thinking that would allow much better user interfaces to be developed.
				 [More]
				</description>
						
				
				<category>Adobe</category>				
				
				<category>Flex</category>				
				
				<category>AJAX</category>				
				
				<category>Conferences</category>				
				
				<pubDate>Tue, 26 Jun 2007 14:06:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2007/6/26/FlexManiacs--Day-2--Mike-Sundermeyer-and-Tom-Hobbs--Adobe-Experience-Design</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Scorpio News</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2007/5/10/Scorpio-News</link>
				<description>
				
				&lt;p&gt;There were a few &lt;a href=&quot;http://ray.camdenfamily.com/index.cfm/2006/10/24/Known-ColdFusion-8Scorpio-Facts&quot;&gt;already
known facts&lt;/a&gt; about the new version of &lt;a href=&quot;http://labs.adobe.com/wiki/index.php/Scorpio&quot;&gt;ColdFusion,
known as Scorpio&lt;/a&gt;. As the tour of user groups to promote the new version
progresses we are beginning to see some interesting postings on various Blogs.&lt;/p&gt;
&lt;p&gt;The first one I noticed was &lt;a href=&quot;http://www.daveshuck.com/blog/index.cfm/2007/5/1/My-notes-and-analysis-of-Ben-Fortas-presentation-to-the-DFWCFUG&quot;&gt;Dave Shuck&apos;s Blog&lt;/a&gt; which has a really comprehensive list of the new features.&lt;/p&gt;

&lt;p&gt;Dave reports on the capability of the new &lt;b&gt;&amp;lt;cfimage&amp;gt;&lt;/b&gt; tag which I
personally asked for in CF6 and CF7 but was disappointed. I don&apos;t expect to be
disappointed this time as the tag seems to do everything I want.&lt;/p&gt;

&lt;p&gt;I was also concerned by the lack of&amp;nbsp; an upgrade for the KTML edit
facility in the new Adobe Dreamweaver Developer Toolbox extensions which have
replaced the Interakt Tools, which we made good use of. I need not have worried
as a better and easier solution has bee provided by the new &lt;strong fixed_bound=&quot;true&quot;&gt;RICHTEXT=&amp;quot;true&amp;quot;&lt;b&gt;
&lt;/b&gt;&lt;/strong&gt;attribute on the &lt;b&gt;&amp;lt;cfinput&amp;gt;&lt;/b&gt; tag.&lt;/p&gt;

&lt;p&gt;Two new tags have been designed to allow easier construction of portal type
sites. &lt;b&gt;&amp;lt;cfpod&amp;gt;&lt;/b&gt; and &lt;b&gt;&amp;lt;cfwindow&amp;gt;&lt;/b&gt; can be used to create
panels that can be resized and moved around. Dynamic menus are also supported by
the &lt;b&gt;&amp;lt;cfmenu&amp;gt;&lt;/b&gt; tag.&lt;/p&gt;

&lt;p&gt;If you want to read a file &amp;lt;cfloop&amp;gt; will now loop over a file.&lt;/p&gt;

&lt;p&gt;The small number of architecture gurus will be happy by the introduction of
the &lt;b&gt;&amp;lt;cfinterface&amp;gt;&lt;/b&gt; tag which allows ColdFusion to implement object
oriented interfaces.&lt;/p&gt;

&lt;p&gt;To pass arguments to tags argumentsCollection can be used in most cases
avoiding some need to create strange logic when different numbers of parameters
are present.&lt;/p&gt;

&lt;p&gt;Integration with other Adobe products is a major benefit in the new version.
Adobe Acrobat Connect users will be pleased to see that presentations can be
created easily with the new &lt;strong fixed_bound=&quot;true&quot;&gt;&amp;lt;cfpresentation&amp;gt;&lt;/strong&gt;,&lt;strong fixed_bound=&quot;true&quot;&gt;
&amp;lt;cfpresenter&amp;gt; &lt;/strong&gt;and&lt;strong fixed_bound=&quot;true&quot;&gt; &amp;lt;cfpresentationslide&amp;gt;
&lt;/strong&gt;tags, while &lt;b&gt;&amp;lt;cfpdf&amp;gt;&lt;/b&gt; allows access to the metadata within a
pdf file, merge pdf files, generate thumbnails, and encrypt pdfs.&lt;/p&gt;

&lt;p&gt;The facilities with pdf files are also enhanced to allow forms to be completed
offline and submitted to CF8 for processing by use of the &lt;b&gt;&amp;lt;cfpdfform&amp;gt;&lt;/b&gt;
tag.&lt;/p&gt;

&lt;p&gt;As far as the cold fusion engine is concerned there is now much better
support for performance tuning, with real time monitoring and the ability to
take snapshots of the server at points when problems occur. Its also possible to
run CF8 in a virtual machine under VMware.&lt;/p&gt;

&lt;p&gt;On &lt;a href=&quot;http://www.forta.com/blog/index.cfm/2007/5/2/Working-With-JSON-In-Scorpio&quot;&gt;Ben
Forta&apos;s Blog&lt;/a&gt; Ben has added more snippets with the news of support for JSON
in AJAX. Two new functions, SerializeJSON() and DeserializeJSON() make it easy
to convert data to and from JSON which is generally regarded as the best way to
move data to and from AJAX applications. In addition, CFC methods can now return
data serialized as JSON by specifying returnformat=&amp;quot;json&amp;quot;.&lt;/p&gt;

&lt;p&gt;Ben also &lt;a href=&quot;http://www.forta.com/blog/index.cfm/2007/5/4/Scorpio-Makes-Syndication-Easy&quot;&gt;tells
us about&lt;/a&gt; another new tag &amp;lt;cffeed&amp;gt; which can be used to read and create
RSS or Atom syndication feeds.&lt;/p&gt;

&lt;p&gt;Regular Expressions &lt;a href=&quot;http://www.forta.com/blog/index.cfm/2007/5/4/Scorpio-Adds-Two-New-RegEx-Functions&quot;&gt;get
two new function too&lt;/a&gt; with the introduction of REMatch() and REMatchNoCase().&lt;/p&gt;

&lt;p&gt;There are &lt;a href=&quot;http://www.forta.com/blog/index.cfm/2007/5/8/Scorpio-Features-Greater-Control-Over-Administrator-And-RDS-Security&quot;&gt;new
security features&lt;/a&gt; in Scorpio, giving increased control and flexibility in
managing ColdFusion Administrator Access and RDS access.&lt;/p&gt;

&lt;p&gt;In his blog, &lt;a href=&quot;http://ray.camdenfamily.com/index.cfm/2007/5/2/Lots-of-Scorpio-ColdFusion-8-News&quot;&gt;Ray
Camden reveals&lt;/a&gt; that CF 8 has a function that checks for the existence of an
array element. There is no longer a need to use try/catch if you have arrays
that potentially have null elements.&lt;/p&gt;

&lt;p&gt;He &lt;a href=&quot;http://ray.camdenfamily.com/index.cfm/2007/5/6/cfObjective--Jason-Delmore-Scorpio-1337&quot;&gt;also
notes&lt;/a&gt; that there are new ways to create arrays and structs and that AJAX is
going to be supported through a number of tags. For example &amp;lt;cfajaxproxy&amp;gt;
will handle &lt;b&gt;all&lt;/b&gt; the JavaScript plumbing to let you invoke any CFC method
from JavaScript, and support for &lt;a href=&quot;http://www.forta.com/blog/index.cfm/2007/3/28/Scorpios-Ajax-Data-Grid&quot;&gt;refreshing
AJAX grid controls&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also create a Spry dataset in CF8.&lt;/p&gt;

&lt;p&gt;Some people are &lt;a href=&quot;http://www.numtopia.com/terry/blog/archives/2007/04/adobe_made_me_obsolete.cfm&quot;&gt;worried
by the new features&lt;/a&gt; and think they might be on the way out. But personally
the &amp;lt;cfexcahnge&amp;gt; tag looks like it will make it possible to move into &lt;a href=&quot;http://www.adamfortuna.com/2007/04/25/coldfusion-8-scorpio-is-coming/&quot;&gt;new
areas of functionality&lt;/a&gt;, and Ian Smith has identified &lt;a href=&quot;http://www.downloadsquad.com/2007/04/24/9-ways-coldfusion-8-will-rule-web-development/&quot;&gt;9
ways for CF8 to rule web development&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;http://www.coldfusionmuse.com/index.cfm/2007/5/2/scorpio.developer&quot;&gt;ColdFusion
Muse&lt;/a&gt; has identified that Scorpio will support the standard set of operators
we are used to seeing from other languages like &amp;quot;++&amp;quot; and
&amp;quot;!=&amp;quot;. He also says that &lt;b&gt;&amp;lt;cfajaxproxy&amp;gt; &lt;/b&gt;allows you to
instantiate CFCs from the client. This exposes the functionality of your CFC in
your JavaScript.&lt;/p&gt;

&lt;p&gt;Among the other good CF8 snippets I found in the blogs were:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;getComponentMetaData - lets you get metadata by passing a path of a CFC. &lt;/li&gt;
  &lt;li&gt;&amp;lt;cfstoredproc&amp;gt; now supports caching&lt;/li&gt;
  &lt;li&gt;query caching now works even when using cfqueryparam&lt;/li&gt;
  &lt;li&gt;&amp;lt;cfftp&amp;gt; now supports sftp&lt;/li&gt;
  &lt;li&gt;cfc serialization for session replication&lt;/li&gt;
  &lt;li&gt;Flash form restrictions removed.&lt;/li&gt;
  &lt;li&gt;Apache Derby, a 100% Java database, will be supported. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I can&apos;t wait.....&lt;/p&gt;
				
				</description>
						
				
				<category>ColdFusion</category>				
				
				<category>AJAX</category>				
				
				<category>Scorpio</category>				
				
				<pubDate>Thu, 10 May 2007 18:21:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2007/5/10/Scorpio-News</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Spry Datasets + Free Beer + Adobe CS3.</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2007/3/26/Spry-Datasets--Free-Beer--Adobe-CS3</link>
				<description>
				
				I have been using Adobe Spry for the last few weeks to present tables of data and alow the user to filter and sort the data on the page.

I must admit I&apos;m really impressed by how easy it is to add these features to a page. Unfortunately I can&apos;t give you a link for what I have done because it&apos;s for an intranet application.

If you&apos;re interested, I will be speaking about it tomorrow eveing at the &lt;a href=&quot;http://www.ukcfug.org/&quot; target=&quot;_blank&quot;&gt;Thames Valley Cold Fusion User Group&lt;/a&gt;.

The meeting will also be linking up with the Launch of Creative Suite 3 from New York and some lucky person will win a copy of CS3 in the raffle. You do have to come along to be entered in the raffle. 

Adobe have offered to pay for the Beer too! Please add a comment to the Blog if you are planning to come along. That way I&apos;ll know how much Beer to buy.

What more could you ask for?
				
				</description>
						
				
				<category>ColdFusion</category>				
				
				<category>AJAX</category>				
				
				<category>Spry</category>				
				
				<category>Photoshop</category>				
				
				<pubDate>Mon, 26 Mar 2007 09:58:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2007/3/26/Spry-Datasets--Free-Beer--Adobe-CS3</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>4:15pm Joe Rinehart - Make AJAX Easy with Model-Glue</title>
				<link>http://www.objectiveaction.com/Kevin/index.cfm/2007/2/1/415pm-Joe-Rinehart--Make-AJAX-Easy-with-ModelGlue</link>
				<description>
				
				Joe gave a good Intro to Ajax Technology and began by pointing out that most people don&apos;t use XML to transfer data from server to client, but use JSON or HTML instead.

The XMLHttpRequest object is used to make the request to the server. Many frameworks can be used to hide the complexity of these calls.

Joe likes the Prototype framework which is very simple to use. A single call can say get this URL and stick the results in a div tag.

For the example application he also used script.aculo.us, an extension to prototype, which provides some additional JS features.

He demonstrated how to create an event handler that deletes a record,&lt;br /&gt;
Include the AJAX and JS frame works,&lt;br /&gt;
Fade the deleted row,&lt;br /&gt;
You should also give some clues to the user that AJAX is being used.

&lt;a href=&quot;https://addons.mozilla.org/firefox/1843/&quot; target=&quot;_blank&quot;&gt;Firebug&lt;/a&gt; was used to show the traffic between the Firefox browser and the server.
				
				</description>
						
				
				<category>ColdFusion</category>				
				
				<category>Conferences</category>				
				
				<category>Frameworks</category>				
				
				<category>AJAX</category>				
				
				<category>Model-Glue</category>				
				
				<pubDate>Thu, 01 Feb 2007 21:28:00+0100</pubDate>
				<guid>http://www.objectiveaction.com/Kevin/index.cfm/2007/2/1/415pm-Joe-Rinehart--Make-AJAX-Easy-with-ModelGlue</guid>
				
			</item>
			
		 	
			</channel></rss>