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

Auto pre-selection of drop down boxes.

Thillai Sakthi
Ranch Hand

Joined: Jun 17, 2000
Posts: 102
Hi All:
Need your help pls.
I have a drop down box which gets its values from db. This is okay for create screen, but for edit screen, I wish to pre-select the value in db in the dd box along with other values. How do I do this struts? The examples I am seeing are all hard-coded examples......

Can you please help?

Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Set the desired value in your ActionForm. This will return the desired value when the dropdown's get method is called on the ActionForm.

A good workman is known by his tools.
I agree. Here's the link:
subject: Auto pre-selection of drop down boxes.
Similar Threads
Display Check Boxes & Dropdowns in Struts with search results
Drop down box
Populating text area
Dynamic Drop down based on another value in the same form
JSP page getting values from DB