aspose file tools*
The moose likes Struts and the fly likes Struts total newby: my drop down list is not returning the selected  value  ww:select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts total newby: my drop down list is not returning the selected  value  ww:select" Watch "Struts total newby: my drop down list is not returning the selected  value  ww:select" New topic
Author

Struts total newby: my drop down list is not returning the selected value ww:select

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 579
In my JSP page I have the following :


<ww:select name="encoderType" value="encoderTypeId" list="encoderList" listKey="encoderId" listValue="encoderName"/>

This works in that it outputs a drop down list.

I select a item but it is not being returned.

As I understand it value="encoderTypeId" is my data holder I set it to 1 so that it always defaults to the first item.

But if I select the next item it should return the next id.

Im my calling Action I have

private String encoderTypeId;

with my getter an setter

public void setEncoderTypeId(String encoderTypeId) {
this.encoderTypeId = encoderTypeId;
}

public String getEncoderTypeId() {
return encoderTypeId;
}

Is my understanding wrong is encoderTypeId not the correct holder for the return value.

When I debug getEncoderTypeId is called when setting the default id for the drop down, but then is not called again on the save.

Thanks for any help


Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 579
Sorted

in <ww:select name="encoderTypeValue" value="encoderTypeId" list="encoderList" listKey="encoderId" listValue="encoderName"/>

name="encoderTypeValue is the return value holder
 
 
subject: Struts total newby: my drop down list is not returning the selected value ww:select