It's not a secret anymore!
The moose likes Struts and the fly likes logic:iterate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "logic:iterate" Watch "logic:iterate" New topic


Achal Jalan

Joined: Nov 23, 2004
Posts: 21

In the following piece of code I am trying to select in the dropdown box the "buId" when equal to the "bu" set in the form and add the other "buchoices" to the drop down list.

"buchoices" has been initialised to {"Abc", "def", "ghi"} in the action class using the set method from the form. And "bu" has been set to "Abc" in the similar manner.

I am failing on 2 counts
1. selecting the value in the drop down when buId == bu
2. showing the rest of the list on the webpage to the user

(timeDetails is the name of the form bean which has has been declared using the usebean tag.)

Any help on how i can do this will be greatly appreciated.

Thanks a bunch
Achal Jalan
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

<html:select property="bu">
<htmlptions property="buchoices"/>

Do that and Struts will take care of the rest.
[ March 22, 2005: Message edited by: Marc Peabody ]

A good workman is known by his tools.
I agree. Here's the link:
subject: logic:iterate
It's not a secret anymore!