This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Struts and the fly likes Retrieving different values in seperate dropdown fbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Retrieving different values in seperate dropdown fbox" Watch "Retrieving different values in seperate dropdown fbox" New topic

Retrieving different values in seperate dropdown fbox

Sege Stephen
Ranch Hand

Joined: Oct 06, 2007
Posts: 51
Hi, I have in my jsp

I am getting some list from the database and I am setting them in my action class. I have two different queries I am running, I want the result of query A to be displayed in list options in Dropdown 1 box and result of query B to be displayed in the list options in Dropdown 2.

What I am getting is the results of both queries are population both dropdowns. How do I specify the dropdown I want a query to be inserted into?

To recap, I am getting the result of two queries in both downdown list, I want the result in seperate list for each query. Ie if the result of query 1 is a,b,c and 2 is d,f,g. I am getting in each dropdown a,b,c,d,f,g.

This is where how I am setting the values

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just make two separate lists (e.g. keys1 and keys2) and base the first dropdown on one, and the second dropdown on the other.

Consultant, Sima Solutions
selvaraju sellamuthu
Ranch Hand

Joined: Jun 28, 2007
Posts: 53
Your problem is in JSP. clearly check your code for bean's two lists value declarations.
Have you checked out Aspose?
subject: Retrieving different values in seperate dropdown fbox
jQuery in Action, 3rd edition