Struts标签之

<s:optiontransferselect  
name="leftUserName"
id="leftUserName" 
list="userInfoList" 
listKey="id"
listValue="userName"
multiple="true"
cssStyle="width:130"  
addToRightLabel="添    加" 
addToLeftLabel="移    除"
doubleName="rightUserName"
doubleId="rightUserName"
doubleList="rigthUserInfoList"
doubleListKey="id"
doubleListValue="userName"
doubleMultiple="true" 

ondblclick="moveSelectedOptions(document.getElementById('leftUserName'), document.getElementById('rightUserName'), false, '');"
doubleOndblclick="moveSelectedOptions(document.getElementById('rightUserName'), document.getElementById('leftUserName'), false, '');" 
 >
</s:optiontransferselect>

Action中rightUserName有get,set,但是就是取不到值,百思不得其解,查了下资料,在表单提交前加上
$("#rightUserName option").each(function(i){
    $(this).attr('selected',true);   
}); 

问题解决

你可能感兴趣的:(java,struts)