ComboBox with Type-Ahead

Here's an enhanced version of the Flex ComboBox with type-ahead functionality. It's evolved over several projects and is stable so I hope others might find it useful.

You can use whatever data provider you need; the filter works against the data in the labelField property. The data provider can be a simple list of strings (as per the example) or complex objects.

Right-click to view and download the source. Feel free to use this in your own projects, make any changes you want, and tell your boss that you created it;) Enjoy...

ComboBox with Type-Ahead [new window]

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Jason's Gravatar I am trying to use your textaheadcombobox (awesome by the way) and I am being thrown an error.

Type Coercion failed: cannot convert mx.core::UITextField@6415c81 to com.mine.views.components.ComboBoxTypeAhead.

This is the line its referencing. var selectedID:int = ComboBoxTypeAhead(event.target).selectedItem.id as int;

My dataprovider is an arraycollection of objects -> {label: "something", id: 76}

Any suggestions?
# Posted By Jason | 8/28/08 3:38 PM
jason's Gravatar Also the close event and change event do nothing when I try to implement this.
I copied your implementation, but changed the handler function to this.

private function updateComponent( event:Event ):void {
_selectedID = Number(componentList.selectedIndex);
trace("Selected item is " + componentList.selectedIndex);
someotherComponent.selectedIndex = int(_selectedID);
//modelLocator.selected
}
# Posted By jason | 8/28/08 5:18 PM
Oliver Merk's Gravatar Not sure. Probably the best thing to do is get my version of the demo running on your local system, then start incrementally changing it to suit your needs.
# Posted By Oliver Merk | 8/28/08 6:24 PM
Freddy's Gravatar thats really great work! i tried to do it myself but didn't come to such a clever solution. great work!
# Posted By Freddy | 9/2/08 10:03 AM
Naren's Gravatar Can the type-ahead functionality be implemented for a
non-editable combobox?
If Yes can anybody please help me with the implementation.
# Posted By Naren | 1/2/09 8:13 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.