Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Tony Evans
Ranch Hand
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorted

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

name="encoderTypeValue is the return value holder
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic