• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Show Manager list based on Department.

 
Nash kumar
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am trying to show list of Managers based on Department selected from a dropdown. I have written the below code. But Department list is duplicated many time(as many as number of managers for that department) and not showing the values in textarea based on department selected. how to achieve this?



 
jatan bhavsar
Ranch Hand
Posts: 297
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nash,

Its wrong to have everything in jsp. You separate the for connection and getting the result from the db but as far as your problem is concern check the results of the query first.

Regards
Jatan

 
Nash kumar
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response. I am aware that not to put the JAVA code in JSP. I put it to explain my issue better. As for Query is concerned, it shows list of Manager Names in one column and Departments in other column.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nash kumar wrote:Thanks for your response. I am aware that not to put the JAVA code in JSP. I put it to explain my issue better.

As you can see, that approach is flawed. All it's doing is to confuse the issue. Post real code.
 
Nash kumar
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Real code consist of values from different files. If you can provide a demo of two drop downs and first having Department list and second Managers list. The second should display the Managers from that department. This will be helpful.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Examples of this using Ajax are all over the web. Please do a search for "cascading dropdowns" or "dependent dropdowns".
 
Nash kumar
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear Bibeault. I did research about this issue in google earlier. However, your suggestion of using the proper keywords in Google search helped me in finding the solution. I appreciate your help.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic