java做批量删除和添加怎么做?是单选框的那种 10
4个回答
2011-03-31
展开全部
<c:forEach items="${exponentlist}" var="exponent">
<tr onMouseOut="this.style.backgroundColor='white'" onMouseOver="this.style.backgroundColor='#F4F4F4'">
<td><input type ="checkbox" name="ids" value="${exponent.id}" <c:if test="${exponent.station==3 }">disabled="disabled"</c:if>/></td>
<td>${exponent.id}</td>
<td>${exponent.markname}</td>
<td>${exponent.name}</td>
<td>${exponent.exptem}</td>
<td>
<c:if test="${exponent.span>50 || exponent.span+50<0}"><img height="13" src="images/red.gif " alt="过高"></c:if>
<c:if test="${(exponent.span<=50 && exponent.span>10) || (exponent.span+50>=0 && exponent.span+10<0) }"><img height="13" src="images/orange.gif" alt="偏高" ></c:if>
<c:if test="${(exponent.span+10>0 && exponent.span<10) || exponent.span+10==0 || exponent.span==10}"><img height="13" src="images/green.gif" alt="平稳"></c:if>
${exponent.span}<c:if test="${exponent.span!=null}">%</c:if>
</td>
<td>${exponent.exponentype}</td>
<td><fmt:formatDate value="${exponent.time}" pattern="yyyy-MM-dd"/></td>
<td>${exponent.cls}</td>
<td><input type="button" class="<c:if test="${exponent.station==1 }">button_style</c:if><c:if test="${exponent.station==2 || exponent.station==3}">button_stylehui</c:if>" name="button" value="发布" onclick="publish(${exponent.id},${curPage});"<c:if test="${exponent.station==2 || exponent.station==3}">disabled="disabled"</c:if>/></td>
<td><input type="button" class="<c:if test="${exponent.station==2 || exponent.station==3}">button_style</c:if><c:if test="${exponent.station==1}">button_stylehui</c:if>" name="button" value="重新发布" onclick="republish(${exponent.id},${curPage});"<c:if test="${exponent.station==1 }">disabled="disabled"</c:if>/></td>
</tr>
</c:forEach>
//java 代码
String[] ids = getRequest().getParameterValues("ids");
for(int i = 0; i < ids.length; i++)
{
Integer id = Integer.parseInt(ids[i].toString());
Calendar cd = Calendar.getInstance();//先实例化对象
Date systime=cd.getTime();
String nowTime=new SimpleDateFormat("yyyyMMddhhssmmS").format(systime);
Ex_subexponent sub=ExponentDataDao.getSubexponent(id);}
<tr onMouseOut="this.style.backgroundColor='white'" onMouseOver="this.style.backgroundColor='#F4F4F4'">
<td><input type ="checkbox" name="ids" value="${exponent.id}" <c:if test="${exponent.station==3 }">disabled="disabled"</c:if>/></td>
<td>${exponent.id}</td>
<td>${exponent.markname}</td>
<td>${exponent.name}</td>
<td>${exponent.exptem}</td>
<td>
<c:if test="${exponent.span>50 || exponent.span+50<0}"><img height="13" src="images/red.gif " alt="过高"></c:if>
<c:if test="${(exponent.span<=50 && exponent.span>10) || (exponent.span+50>=0 && exponent.span+10<0) }"><img height="13" src="images/orange.gif" alt="偏高" ></c:if>
<c:if test="${(exponent.span+10>0 && exponent.span<10) || exponent.span+10==0 || exponent.span==10}"><img height="13" src="images/green.gif" alt="平稳"></c:if>
${exponent.span}<c:if test="${exponent.span!=null}">%</c:if>
</td>
<td>${exponent.exponentype}</td>
<td><fmt:formatDate value="${exponent.time}" pattern="yyyy-MM-dd"/></td>
<td>${exponent.cls}</td>
<td><input type="button" class="<c:if test="${exponent.station==1 }">button_style</c:if><c:if test="${exponent.station==2 || exponent.station==3}">button_stylehui</c:if>" name="button" value="发布" onclick="publish(${exponent.id},${curPage});"<c:if test="${exponent.station==2 || exponent.station==3}">disabled="disabled"</c:if>/></td>
<td><input type="button" class="<c:if test="${exponent.station==2 || exponent.station==3}">button_style</c:if><c:if test="${exponent.station==1}">button_stylehui</c:if>" name="button" value="重新发布" onclick="republish(${exponent.id},${curPage});"<c:if test="${exponent.station==1 }">disabled="disabled"</c:if>/></td>
</tr>
</c:forEach>
//java 代码
String[] ids = getRequest().getParameterValues("ids");
for(int i = 0; i < ids.length; i++)
{
Integer id = Integer.parseInt(ids[i].toString());
Calendar cd = Calendar.getInstance();//先实例化对象
Date systime=cd.getTime();
String nowTime=new SimpleDateFormat("yyyyMMddhhssmmS").format(systime);
Ex_subexponent sub=ExponentDataDao.getSubexponent(id);}
展开全部
java做批量添加或删除要结合js去做然后在url中直接传数组,然后在后台用数组接收,在用循环数据里的数据然后进行数据持久化操作!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
没明白,是指从数据库删除数据还是指界面显示的元素删除
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
单选还用批量??
给条件删除喽
给条件删除喽
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询