Niza Berg wrote: I needed to make my JSP page more cleaner and have these things be separate out. So was curious if I can separate this out
Yes, this is a good idea.
I would be fine to go via any of these either: JSON approach to parse and then display or create a property file and have them store it in key-value pair and further do such. Any basic example how step by step these things can work would be a great start for me to have the base and jump into complex structure.
To be honest, since you are already connected to a DB, I'd store the values in the DB rather than deal with Ajax at the client. But if you want to go the Ajax route, I'd suggest using jQuery's
$.getJSON() function to fetch the JSON data, and then jQuery's DOM manipulation API to create the
<option> elements from the data. Make sure that you do this in a ready handler so that the DOM is loaded before you execute the script.
P.S: I will be fine to know what other approaches you think would be a better way other then a drop down to show 1000's of data. This would be a good start for me. :)
Auto-completer.
A dropdown with more than a dozen or so options quickly becomes cumbersome. More than one hundred or so, and it becomes useless.