struts2中action如何获得<s:optiontransferselect />的值
jiang0723
2008-10-15
jsp中的<s:optiontransferselect />标签已正常显示使用
<s:optiontransferselect tooltip="用户权限" label="设置权限" name="mhPopedom.leftList_1" leftTitle="用户未授权限" list="leftList_1" listKey="popeId" listValue="popeName" headerKey="headerKey" multiple="true" emptyOption="false" allowUpDownOnLeft="false" cssStyle="width:200px;height:300px;" cssClass="input2" addToLeftLabel="向左移动" addToRightLabel="向右移动" addAllToLeftLabel="全部左移" selectAllLabel="全部选择" addAllToRightLabel="全部右移" doubleName="rightPopedom" rightTitle="用户已授权限" doubleList="rightList_1" doubleListKey="popeId" doubleListValue="popeName" doubleHeaderKey="doubleHeaderKey" doubleMultiple="true" doubleEmptyOption="false" allowUpDownOnRight="false" doubleCssClass="input2" doubleCssStyle="width:200px;height:300px;"> </s:optiontransferselect> 但不论怎样在action中都不能获得rightPopedom的值,报空指针异常。 请各位帮忙,在线急等!!!! |
|
flybida
2009-07-28
后台action里面添加属性(setXXX和getXXX方法):
private String[] leftList; private String[] rightList; 在前台页面上,当提交表单时,onclick事件调用下面的js: <script type="text/javascript"> function myself(){ var right=document.forms[0].rightList; for(i=1; i <right.length; i++) right[i].selected = true; } </script> 提交后,就能在后台得到rightList里面的值了。 如果没有这段Js代码,后台是得不到值的,这是Struts2 <s:optiontransferselect/>本身的bug. |
|
hukkkk
2009-08-24
很好,在form中使用<s:submit/>也能够取到值
|
相关讨论
相关资源推荐
- win7浏览器主页修改不过来_win7系统浏览器主页修改不了的解决方法
- IP协议优化技巧:提升网络性能和稳定性的秘诀
- 本地连接属性:Internet协议版本4(TCP/IPv4)打开闪退解决办法
- 加快外网访问速度
- struts <s:optiontransferselect/>使用
- struts2的 action中得到<s:optiontransferselect/>标签中的内容
- action中得到<s:optiontransferselect/>标签中的内容
- S:标签实际大全(struts2)
- Struts标签之<s:optiontransferselect/>
- Struts2中s标签的用法