我试图在Struts2 + Hibernate中使用optiontransferselect
将值从一个列表传输到另一个列表并将其保存到数据库中。
<s:form name="frmIssueSerialDetails" action="SaveIssueSerialDetails" >
<s:optiontransferselect name="esr.stdId"
listKey="stdId"
listValue = "stStockSerialNo"
leftTitle = "Available Serial No:"
rightTitle = "Selected Serial No:"
list = "listStockRecSerialNoLeft"
multiple = "true"
doubleMultiple="true"
headerKey = "-1"
headerValue = "-- Serial Numbers --"
doubleList = "listStockRecSerialNoRight"
doubleName = "eisd.erpmStockReceived.stId"
doubleListKey = "erpmStockReceived.stId"
doubleListValue = "stStockSerialNo"
doubleHeaderKey = "-1"
doubleHeaderValue="-- Serial Numbers --"
cssClass="queryInput"
doubleCssClass="queryInput"
doubleId="right" />
<s:submit value="Save Issue Serial No" />
</s:form>
listStockRecSerialNoLeft
填充得很好,但我无法将值从listStockRecSerialNoLeft
转移到listStockRecSerialNoRight
。我还想将传输的值从listStockRecSerialNoRight
保存到数据库。
但
当我删除listKey
后,我就可以将值从listStockRecSerialNoLeft
移到listStockRecSerialNoLeftRight