File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts Drop Down List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Drop Down List" Watch "Struts Drop Down List" New topic

Struts Drop Down List

Ger Gleeson

Joined: Dec 14, 2005
Posts: 3
How do you show more than one field of a drop down list eg. I have a flight collection and i want to be able to select the flightID from a drop down list while also being able to see the destination and departure airports.
I am currently using a <html:select> and <html ptions> but cant seem to figure it out, please help
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Moved to the Struts forum.

[Asking smart questions] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Since the <select> control only allows you to display a single string, you will have to concatenate several pieces of data into a single field. For example, if the bean you're using to populate the options has a getLabel() method that's currently showing "1234", you need to modify it so that it produces: "flt: 1234 depart:Los Angeles arrive: New York City".

Consultant, Sima Solutions
I agree. Here's the link:
subject: Struts Drop Down List
jQuery in Action, 3rd edition