Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replacing Entire Select Box

 
A.S. HariLal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
I have a problem with the select box. There are 3 radio buttons and two combo box(select boxes). According to the radio button selected I have to display some static datas on first combo and some dynamic datas(loaded from data base)on the second combo. If any one have a solution please help me, Thanks in Advance
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fill the static data into select box isn't a big deal.. a little search on google will give you more and more example..

for the next select box, you haven't tell us whether what technology or technique you're use for getting the data from the database.
 
A.S. HariLal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friend,
I am working with struts frame work. In the beginning I store the values to a ArrayList and that to be shown in the combo/select box.
For example, there are two array lists one for storing Teachers Name and other for students. By selecting the radio button "Student" Dynamic select box will be filled with Student Name(Which I Stored to a Arraylist in the beginning)and similarly by selecting the radio Teacher the select box will be filled with Teachers name. On the otherhand the ststic select box is for selecting the age range. I hope now you can understand what the idea is.....Hope solutions...........Thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have all the data you need when the JSP is executing, then you can create JavaScript data structures to hold that data for later use in populating the dynamic select element. If not, you'll need to make an Ajax call in order to fetch that data (JSON would be a good data exchange format for this).
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might help you to step forward...
 
A.S. HariLal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
If there is a example please post here, I hope it will be more helpful for me.......Thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by A.S. HariLal:
If there is a example please post here
There are examples all over the web. Please show some effort.
 
A.S. HariLal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
Thanks for your valuable suggestion, I got the logic and hope it can be successfully implement......Once again thanks for all...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic