wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Drop Down List" Watch "Struts Drop Down List" New topic
Author

Struts Drop Down List

Ger Gleeson
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Moved to the Struts forum.


[Asking smart questions] [Bear's FrontMan] [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".


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Drop Down List
 
Similar Threads
populating textarea from dropdown box selection
html:option selected
Dropdown with ArrayList attribute in FormBean
Combo Box search as user types
How to enable 2nd dropdown.