Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get selected value from struts dropdown list?

Status
Not open for further replies.

SilverStray

Programmer
Oct 25, 2001
47
0
0
AU
Hi,

I have a bean class called Parameter, which is defined by the following attributes:

public class Parameter implements Serializable
{
private final String name;
private String value;
private List paramOptions;

...constructor and getter and setter...
}

In my form, paramOptions shows as a dropdown list.

<nested:notEmpty name="parameterList" property="paramOptions">
<html:select name="parameterList" property="value" >
<bean:define name="parameterList" property="paramOptions" id="pList"/>
<htmlptions collection="pList" property="paramOptionName" labelProperty="paramOptionLabel" />
</html:select>
</nested:notEmpty>

1)I am passing the bean with the property called value which is empty. But the paramOptions is a List.
However, when i submit the form, i want to pass the value selected in the dropdown list to the property called value. Is it possible to do this?

2)how do i get the item selected from the dropdown list?

Please help.

THanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top