ColdFusion and JavaScript - text field autocomplete

kasiencja
kasiencja used Ask the Experts™
on
I'm maintaining a website designed in ColdFusion which utilizes JavaScript for autocomplete of  account names.  My problem is that some clients have so many accounts that a page can take over a minute to load, yes over a minute.  So... I'm trying to figure out if there might be a way or workaround for this issue.

Thanks,
Kate
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
This is less of a coding issue, and more of a user experience issue. From the technical side, you have to put a limit on the number of items you retrieve. That's something you should probably take up with a product manager or person of that type to see what's realistic. For those clients that have tons of accounts, you can add a "more..." link to the bottom of the list that will direct them to a complete list of their accounts. Sure, it's an extra click, but it'll save you a big headache in trying to optimize the AJAX.

Another thing to consider is to get chunks of data at a time. That way you can ultimately show all the accounts, but they come up in chunks as opposed to all at once. It's sort of "lazy-load."

Author

Commented:
Hey GoofyDawg, thanks you very much for your comment.  I'm the only person now responsible for this project; I have a fairly good understanding of it now but I'm trying to fix it up as I continue on analyzing it.  This is one of the biggest issues and the problem with having a next button is that the user doesn't actually see a list of the accounts; the accounts are loaded in the background and utilized for a single text field with autocomplete function; such that if you type AP, all accounts starting with AP will be listed in a combo-box like way and as more characters are typed in the list is refined.  

You mentioned getting chunks of data... how would I go about doing that with CF and JS.

Thank you!
You could set up a setInterval function that does a fetch. I'm not really familiar with CF, but from the JavaScript side, that's how I'd do it. Just set the interval for every half second or so, and just add stuff to your destination container as needed.

Author

Commented:
Thanks, I'll do a quick test on that.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial