Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

drop down list pair population

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I would like to know if it is possible to have two drop down lists in a JSP such that choosing an option on one populates the other. Both the lists are to be populated from arrays.
Is it possible to do this without using java script? If so please let me know how with an example.
thanks a lot
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tony_al
Welcome to the Java Ranch, we hope you�ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
As far as your question, keep in mind that the only way to let the server know that something has been selected is to make a round trip and send it some sort of a request. Basically the oly thing a JSP (or a servlet for that matter) do is send a response to the browser after they ae done processing the request. To get new inofrmation/outpu from a JSP or servlet you need to send a new request and get a new response. To do something like this and not make another round trip to the server you would almost have to use javascript. The only other solution I can think of would be an applet but I'm not familiar enough with them to tell you, but there you'd still be making a round trip to the server to get the data to populate the list.
hope that helps
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic