Sam Farmer

Growing up I never imagined I would play bass guitar for the Dave Matthews Band. And indeed it never happened.

But I have become passionate about making software.

cfaui (Adobe User Intelligence) tags and functions up on Adobe Labs

April 1, 2008

The most exciting feature of the ColdFusion 8 Updater 1 (now posted to Adobe Labs) is the new cfaui tags and functions. aui stands for Adobe User Intelligence and allows us CF developers to do a whole bunch of new cool stuff (rumors suggest a Flex version is on the way as well).

It is based on the technology in cfajaxproxy and the embedded Apache Derby database and can be added to any page by placing

<cfaui action="track" trackID="#session.userID">

anywhere on the page. This will track all actions a user takes on the page, store it in a database and constantly analyze it. The first cool usage is the action="hover" attribute which after a set period will display the text in any element defined on the page. Here's an example:

<cfaui action="hover" element="hoverTR" milliseconds="1000"  messageElement="messageSpan" message="Most people pick chocolate" />  <tr id="hoverTR">    <td>Favorite Ice Cream</td>    <td><input type="text" name="favIceCrean">     <span id="messageSpan"></span></td> </tr>

What this does is after 1000 seconds of a user hovering over the the tr with the id of "hoverTR" it will place the content of the message attribute in the span with the id of "messageSpan".

One UI challenge I have always faced is whether to use a text box or select box for collecting a US state. Well with the new auiInputPreference function its now possible to give the user what they would prefer. Look at this example:

<cfif auiInputPreference(session.userID, "keyboard")>   <input type="text" name="state"> <cfelse>    <select name="state">.... </cfif>

The auiInputPreference function will always return a boolean. In this example I ask if the user has shown a preference for using the keyboard and if so will display a text box, if not (and in this case it would mean they lean towards using the mouse to move between fields) show a select box.

There are many other cool functions and features of the aui suite of tags and functions. Head over to the Adobe Labs and check out the documentation on the beta for ColdFusion 8 Updater 1.


No Comments

Some comments have been lost over the years due to moving hosts.

More


More blog entries that I have written.

Code coloring by PRISM.