This content has been marked as final. Show 3 replies
Not to burst your bubble, but I think that component already exist.
In fact, a few have been posted on the exchange: http://www.adobe.com/cfusion/exchange/index.cfm?searchfield=autocomplete&search_exchange=& num=25&startnum=1&event=search&sort=0&Submit=
If you are doing it so that you learn how, I'd need to see the code. Post it on a url with the source if you can.
Don't worry, my bubble is not burst! I did look at some of that code for some ideas, but then wanted to try to do it myself for (as you said) a learning experience. Also I wanted to customise my control a bit, for example I want to complete where any option text is a substring, rather than just "begins with" the typed text. I hadn't actually tried out those components you suggested, but I've just done so now and... the one I tried suffers from the same problem! (This is the control entitled "Adobe AutoComplete Input"). They have increased the scroll speed so it's not as obvious, but nevertheless, it still has the problem.
Anyway, here's my source code. Bear in mind I've only just started using Flex, so it may well be a load of rubbish! Please note that it matches on substrings, not "begins with" strings. It also inserts and removes from the option list whilst maintaining alplabetical order (this insert/remove may be unnecessary though). It contains a pre-setup list of complete strings so you can just embed it directly into a simple test app and you should be able to see it working.
As I said, I expect this is something to do with dataProvider binding, but I'm not sure...
It would be great if you could take a look and let me know if you have any suggestions.
Just a quick note: To test it, run the app then just type "aaa" into the box. The list scrolls up and down each time you type "a" (as items are removed from the complete list). Then delete the "a"s one at a time and see how the list does not scroll up and down (as items are added to the complete list).