This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Generating dynamic combo using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Generating dynamic combo using java" Watch "Generating dynamic combo using java" New topic

Generating dynamic combo using java

Vinay Naidu

Joined: Sep 22, 2003
Posts: 1
I have to generate a dynamic combo ..
ex: on selecting Department it should show the sub departments it have under its.
My front end is a jsp page if i select a department ..sub department should also be showm in the next combo by connecting to the database Oracle.
So if any one has a code to generate a dynamic combo please send it to or post it here
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi Vinay
One option to this implementation would be to pre-load the association of Departments and Subdepartments in JavaScript Array and then just load the appropriate subdepartment list via JavaScript. This would make the application to be little 'un real' as we won't be querying the database each time we select a value for department from the combo but it will depend what exactly you want...Do you want to query database on every combo seletion event or not...
It is sorta covered in the JavaRanch Style Guide.
subject: Generating dynamic combo using java
Similar Threads
Dynamic Combo Box
Use Comparator to sort more than one column
Swing + JComboBox
How to invoke a method in action class
dynamic component invalidate/validate painting issue (image examples included)