Sunday, November 23, 2008    
Home My Books Blog ColdFusion About Me Back    

Calendar
<< Mar 2007 >>
S M T W T F S
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
             

Search

Categories
 • Acrobat (2) [RSS]
 • Adobe (71) [RSS]
 • AdobeMAX06 (45) [RSS]
 • AdobeMAX07 (59) [RSS]
 • AdobeMAX08 (46) [RSS]
 • AIR (144) [RSS]
 • Appearances (133) [RSS]
 • Books (69) [RSS]
 • CFEclipse (14) [RSS]
 • ColdFusion (1173) [RSS]
 • Data Services (16) [RSS]
 • Fish Tank (2) [RSS]
 • Flash (108) [RSS]
 • Flex (382) [RSS]
 • Home Automation (3) [RSS]
 • Jobs (100) [RSS]
 • JRun (13) [RSS]
 • Labs (29) [RSS]
 • LiveCycle (23) [RSS]
 • MAX (181) [RSS]
 • Regular Expressions (15) [RSS]
 • RIA (12) [RSS]
 • SQL (38) [RSS]
 • Stuff (505) [RSS]
 • Tips (CF Studio) (80) [RSS]
 • Tips (CF) (795) [RSS]
 • Tips (Dreamweaver) (91) [RSS]
 • Tips (Flex Builder) (2) [RSS]
 • Using CF (140) [RSS]
 • Wireless (100) [RSS]

Other BLOGs
 • Charlie Arehart
 • Lee Brimelow
 • Ray Camden
 • Christophe Coenraets
 • Sean Corfield
 • Mihai Corlan
 • Cornel Creanga
 • John Dowdell
 • Danny Dura
 • Enrique Duvos
 • Steven Erat
 • Kevin Hoyt
 • Serge Jespers
 • Adam Lehman
 • Duane Nickull
 • Miti Pricope
 • Andrew Shorten
 • Ryan Stewart
 • James Ward
 • Greg Wilson
 • Full As A Goog

RSS Feeds
 • Feed
 • Subscribe

Join my mailing list and find out about new books and other topics of interest.

Thoughts, ideas, tips, musings, and pontifications (not necessarily in that order) by Ben Forta ...
NOTE: This is my personal blog, and the opinions and statements voiced here are my own.

Viewing By Entry / Main
March 26, 2007

Scorpio Auto-Suggest Control

Last week Tim and I showed off some of the Ajax functionality that we are working on for the upcoming ColdFusion Scorpio. One of the controls we demonstrated was an auto-suggest control implemented as an extension to the existing <cfinput>l tag. As demonstrated, the tag can be used in two ways. It can use a hard coded list, like this:

<cfinput type="text"
   name="fruit"
   autosuggest="apple,banana,lemon,lime,mango,orange,peach,pear">

Of course, the list need not be static, it could be programmatically generated at runtime as needed. This is an ideal option for shorter lists.

For longer lists the suggestions can be populated via asynchronous calls back to a ColdFusion Component on the server after a delay in typing. The syntax would look something like this:

<cfinput type="text"
   name="fruit"
   autosuggest="cfc:fruit.getFruit({cfautosuggestvalue})">

This points to a CFC named fruit.cfc in the same folder and invoked a method named getFruit() passing the current field value as an argument. The invoked method receives that argument as a string, does whatever processing it needs (perhaps using it in a ) and then returns results which are then used to populate the list.

Of course, all of this is subject to change, but you get the idea.

Related Blog Entries

TrackBacks
There are no trackbacks for this entry.

No trackback URL. Trackbacks are only allowed via interactive form.

Comments
Ben,

Thats a very nice feature, there are so many new things in CF8 that I actually missed that one, wonder how many others i've missed.

This will be the best CF release yet, great work. I'm counting the days until I can buy the upgrade.
# Posted By Dale Fraser | 3/27/07 12:39 AM
I can see how this would be very, very useful. Looking forward to playing around with Scorpio . . .
# Posted By Lola LB | 3/27/07 6:47 AM
I'd much rather be working on the back end CFCs, so things like are wonderful to see. I can't wait.

Hopefully, we'll also get the necessary functions or CFC output types to easily format something like query data into a format that is usable by this cfinput type. Thank you guys for putting great stuff like this into 8. :-)
# Posted By Dan | 3/27/07 12:13 PM
Dan, I agree, all of the obvious types should be directly supported. The version that Tim and I used requires that the CFC method return an array, but we're not done yet.

--- Ben
# Posted By Ben Forta | 3/27/07 12:18 PM
Maybe something like would be a nice enhnacement for this EXCELLENT feature:

<cfinput type="text" name="fruit" autosuggesttype="query || array || list(default)" autosuggestcolumn="fruitname" />

- Give the autosuggest a different datatype, like a query or array instead of the default list
- When a different datatype is selected, provide the name of the column where to find it

It's a lot to ask, but just my 2 cents....
# Posted By Michael van Leest | 3/30/07 12:06 PM
Michael, nah, if we support more types then the detection should be automatic. This is ColdFusion, it's all about doing less to get more done! ;-)

--- Ben
# Posted By Ben Forta | 3/30/07 12:16 PM
Even better if you would consider it.... :-)
# Posted By Michael van Leest | 3/30/07 1:40 PM
Can you define / change the maximum number of suggestions that are shown?

Seems like quite a small max number, having a similar issue with valuesdisplay in the html cfgrid only showing 12 values max in any drop down.
# Posted By Doug Cain | 8/31/07 8:32 AM
Is it possible to pass another argument to the cfc with the cfautosuggestvalue
# Posted By Travis | 4/9/08 7:12 PM

  © Copyright 1997-2008 Ben Forta, All Rights Reserved