<table>
<thead>
<tr>
<th width="100"><s:checkbox id="doAllSele" value="" οnclick="selectAll()" name="jcgwVO.img" theme="simple"></s:checkbox></th>
<th width="100">序号</th>
<th width="100">caseNo</th>
<th width="100">caseName</th>
<th width="200">caseDate</th>
<th width="100">caseAddress</th>
<th width="100">inPhone</th>
<th width="100">binRenXuQiu</th>
<th width="200">daoYuanDate</th>
<th width="400">remark</th>
<th width="100">zhiBanYuan</th>
<th width="100">isCaseOver</th>
</tr>
</thead>
<s:iterator id="caseinfo" value="caseinfolist" status="st">
<tr>
<td><s:checkbox id="doSele" name="jcgwVO.gwmc" theme="simple"></s:checkbox></td>
<td><s:property value="#st.phoneId" />${st.index+1}</td>
<td><a href="caseinfo.action?caseinfo.caseNo=${caseinfo.caseNo}" target="_blank">${caseinfo.caseNo}</a></td>
<td>${caseinfo.caseName}</td>
<td>${caseinfo.caseDate}</td>
<td>${caseinfo.caseAddress}</td>
<td>${caseinfo.inPhone}</td>
<td>${caseinfo.binRenXuQiu}</td>
<td>${caseinfo.daoYuanDate}</td>
<td>${caseinfo.remark}</td>
<td>${caseinfo.zhiBanYuan}</td>
<td>${caseinfo.isCaseOver}</td>
</tr>
</s:iterator>
</table>
struts2标签 <s:checkbox> 的全选与反选:
<script type="text/javascript">
function selectAll(){
var click = document.getElementById("doAllSele").checked;
var arryObj = document.getElementsByName("jcgwVO.gwmc");
for(var i=0;i<arryObj.length; i++){
if(typeof arryObj[i].type != "undefined"
&& arryObj[i].type == "checkbox"){
if(click == true){
arryObj[i].checked = true;
}else{
arryObj[i].checked = false;
}
}
}
}
</script>