0

我正在使用struts 1.1,我有两个具有相同数据的下拉列表(下拉列表)。我必须将选定的两个值作为 varchars 保存在两个不同的列中。
我可以使用在表单中为两个下拉菜单创建的相同地图来完成此操作吗?

例如,下面是一个保存用户 ID 的下拉菜单,假设还有另一个类似的下拉菜单,我保存创建用户 ID,它们都使用相同的填充用户列表。

<html:select property="selectedCancelUserId">
     <html:option value="">-</html:option>
     <html:optionsCollection property="usedByUserList" label="name" value="staffNo"/>
</html:select>
4

1 回答 1

0

您需要有两个不同的表单变量,例如selectedCancelUserIdselectedCreateUserId在表单中以捕获来自用户的两个不同输入。usedByUserList只要您将表单值与它们关联,就可以在表单中多次使用它们进行显示。

 <html:select property="selectedCancelUserId">
       <html:option value="">-</html:option>
       <html:optionsCollection property="usedByUserList" label="name" value="staffNo"/>
 </html:select>

 <html:select property="selectedCreateUserId">
       <html:option value="">-</html:option>
       <html:optionsCollection property="usedByUserList" label="name" value="staffNo"/>
 </html:select>
于 2013-04-24T06:38:15.227 回答