我遍历了一个集合,我要吧集合里面ID这个属性放到CheckBox里面
提交把选中的ID传到Action
页面怎么写,ACTION怎么写 要考虑多选后传多个ID的问题。
后面TYPE==1可以无视 那是加的一个判断。
主要是传参与接受 怎么写 各位大神 教教小弟阿。
<logic:iterate id="tkx" name="pecForm" property="EmptyBoxList" >
<tr>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> >
<input type="checkbox" name="id" value=${id} ${type==1 ? "disabled='disabled'" :"" }/>
</td>
</logic:iterate>
提交把选中的ID传到Action
页面怎么写,ACTION怎么写 要考虑多选后传多个ID的问题。
后面TYPE==1可以无视 那是加的一个判断。
主要是传参与接受 怎么写 各位大神 教教小弟阿。
<logic:iterate id="tkx" name="pecForm" property="EmptyBoxList" >
<tr>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> >
<input type="checkbox" name="id" value=${id} ${type==1 ? "disabled='disabled'" :"" }/>
</td>
</logic:iterate>
var inputs = document.getElementsByTagName("input");
var val = "";
for(var i = 0; i < inputs.length; i++) {
if(inputs[i].type == "checkbox" && inputs[i].checked) {
val = val== "" ? inputs[i].value : "," + inputs[i].value
}
}document.forms[0].action = "xxx.action?val=" + val;
document.forms[0].submit();
一次可选多条,点更新 就把修改的更新
大哥 怎么写阿 没头绪。
给我点头绪 40分给你 呵呵。
我要从页面更新, where 条件是多选ID的值, 更新的内容是个文本框的值
一次可选多条,点更新 就把修改的更新
大哥 怎么写阿 没头绪。
给我点头绪 40分给你 呵呵。
<input type="checkbox" name="box" value="2">
<input type="checkbox" name="box" value="3">
<input type="checkbox" name="box" value="4">
后台request.getParameterValues("box");得不到???
页面:<input type="checkbox" name="ids" value="${id}"/>
action里:定义private Long[] ids; 使用setter getter方法获取就可以得到ids的值了。
行的话,结贴哈!
后台request.getPar...得到的是String[]
String value1="";
for(int i=0;i<name.length;i++){
value1= name[i]+"☆";
out.print(value1);
}
%>
用我查询出来的那个对象? 自动映射的嘛? 需要继承ActionForm?
<td class="BTABBODY2" valign="top" width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td class="tabletitle" nowrap ></td>
<td class="tabletitle" nowrap width="10%">TRIP号</td>
<td class="tabletitle" nowrap width="10%">供应商号</td>
<td class="tabletitle" nowrap width="10%">供应商名称</td>
<td class="tabletitle" nowrap width="10%">送货仓库代码</td>
<td class="tabletitle" nowrap width="10%">送货仓库名称</td>
<td class="tabletitle" nowrap width="10%">料箱名称</td>
<td class="tabletitle" nowrap width="10%">空箱数量</td>
<td class="tabletitle" nowrap width="10%">工厂代码</td>
<td class="tabletitle" nowrap width="10%">实取数量</td>
<td class="tabletitle" nowrap width="10%">类型</td>
</tr>
<%int n=0;int i=0;%>
<logic:iterate id="tkx" name="pecForm" property="EmptyBoxList" >
<tr>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> >
<input type="checkbox" name="id" value=${id} ${type==1 ? "disabled='disabled'" :"" }/>
</td>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="tripid" /></td>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="supplier_code" /></td>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="suppliername" /></td>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="location_code" /></td>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="locationdesc" /></td>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="name" /></td>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="packageQty" /></td>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="factory_code" /></td>
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><input type="text" value="<bean:write name="tkx" property="re_qty" />" size="8" ${type==1 ? "readonly='readonly'" :"" } ></td>
<logic:equal name= "tkx" value= "0 " property="type">
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap>未提取</td>
</logic:equal>
<logic:equal name= "tkx" value= "1" property="type">
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap>已提取</td>
</logic:equal>
</tr>
<%n++;%>
</logic:iterate>怎么把多选绑定ID 提交的时候 把文本框的值 和多选框的值传过去。 循环查询。