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.
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.
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. :-)
--- Ben
<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....
--- Ben
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.