• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Populating a combobox dinamically from a database

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
I have 2 combobox. When i choose the option in the first combobox (a onChange event) i want to access a database (mysql or oracle) to get the list to populate the second combobox.
I have to use a database because there are many options in the first combobox.
Does anyone knows how to do this???
Thanks
Claudia Vaz
 
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Claudia,
I think if you want to do it dynamically at front end you have to bring all the data at the front end on the html page. Store it in some array in a javascript and then on change build your drop down dynamically without going back to oracle or some database.
Vijay
 
Claudia Vaz
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
thanks for answer.
To use your solution i would have to have 332 arrays, and some of many of these arrays would have more than 300 positions. Would it cause a problem to the jsp file( i know that the jsp compilation has a limit of 64kb)??
Claudia Vaz
 
Vijay S. Rathore
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well you can concatenate the data using some special character to reduce the array size drastically and then use the split method at the javascript end to regenerate the values. Split works just like StringTokenizer in Java.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic