社区
Web 开发
帖子详情
关于list循环到前台更新不了的问题
gx2425030
2009-03-25 01:12:59
我在jsp前台循环出list,把list其中的一条记录修改后提交,然后在跳回该jsp页面但是跳回来还是修改前的记录,没有返回修改后的list。
...全文
173
5
打赏
收藏
关于list循环到前台更新不了的问题
我在jsp前台循环出list,把list其中的一条记录修改后提交,然后在跳回该jsp页面但是跳回来还是修改前的记录,没有返回修改后的list。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
gx2425030
2009-03-25
打赏
举报
回复
父窗口代码
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<html>
<head>
<title>车辆调拨</title>
<link rel="stylesheet" type="text/css"
href="${pageContext.request.contextPath}/css/style.css">
<script type="text/javascript"
src="${pageContext.request.contextPath}/js/date.js"></script>
<script type="text/javascript">
function oop(url){
<%-- alert(gongsi)--%>
window.open(url,"" ,
"toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=300,height=100,left=300, top=200");
}
</script>
</head>
<body>
<html:form action="jihuafenpei.do" method="post" styleId="form1">
<fieldset style="width:100%;padding-bottom:5px;">
<legend>
<b>承运任务管理</b>
</legend>
<table>
<input type="hidden" name="method" value="findByTimeandCom" />
<tr>
<td>
请选择查询时间:
</td>
<td>
<html:text property="danqianriqi"
onclick="CalendarWebControl.show(this,false,this.value);"
style="width:100px" />
</td>
<%-- <td>--%>
<%-- 请选择运输公司:--%>
<%-- <c:if test="${account.partname eq '3'}">--%>
<%-- <input type="text" name="yunshugongsi" value="${account.username}" readonly="readonly" />--%>
<%-- </c:if>--%>
<%-- <c:if test="${account.partname ne '3'}">--%>
<%-- <input type="text" name="yunshugongsi" />--%>
<%-- </c:if>--%>
<%-- </td>--%>
<td>
<html:submit style="width:90px" value="查询未审核"
onclick="method.value='findByTimeandCom'" styleClass="BigButton" />
</td>
<%--<input type="hidden" name="method" value="findByTimeandCom" />--%>
<td>
<html:submit style="width:90px" value="查询以审核" onclick="method.value='findByTimeandCom1'" styleClass="BigButton"/>
</td>
</tr>
</table>
</fieldset>
<br>
<br>
<table border="0" cellspacing="1" class="tablestyle1">
<logic:present name="list">
<tr class="TableHeader" align="center">
<td>
计划批次
</td>
<td>
计划录入时间
</td>
<td>
分配日期
</td>
<td>
发车地点
</td>
<td>
运输公司
</td>
<td>
销售店
</td>
<td>
省份
</td>
<td>
是否调拨任务
</td>
<td>
台数
</td>
<td>
车牌号
</td>
<td>
操作
</td>
</tr>
<logic:iterate id="templist" name="list" >
<tr class="TableLine1" align="center">
<html:hidden property="idbiaoshi" value="${templist.idbiaoshi}"/>
<td>
<bean:write name="templist" property="jihuapici"/>
</td>
<td>
<bean:write name="templist" property="jihuashijian"/>
</td>
<td>
<bean:write name="templist" property="danqianriqi" />
</td>
<td>
<bean:write name="templist" property="jihuadidian"/>
</td>
<td>
<bean:write name="templist" property="yunshugongsi"/>
</td>
<td>
<bean:write name="templist" property="xiaoshoudian"/>
</td>
<td>
<bean:write name="templist" property="shengfen"/>
</td>
<td>
<bean:write name="templist" property="shifoudiaochu"/>
</td>
<td>
<bean:write name="templist" property="taishu"/>
</td>
<td>
<%-- <input type="text" name="cifatianshu" value="${templist.cifatianshu}"/>--%>
<%-- <html:text property="cifatianshu" value="${templist.cifatianshu}"/>--%>
<bean:write name="templist" property="cifatianshu"/>
</td>
<td>
<%-- <a id="xyz" href="${pageContext.request.contextPath}/jihua/carnumber.jsp?id=${templist.idbiaoshi}&page=${fenye.nowpage}&shijian=${shijian}&gongsi=${gongsi}">完成</a>--%>
<a id="xyz" href="javascript:oop('${pageContext.request.contextPath}/jihua/carnumber.jsp?id=${templist.idbiaoshi}&page=${fenye.nowpage}&shijian=${shijian}&gongsi=${gongsi}');">填写车牌</a>
</td>
</tr>
</logic:iterate>
</logic:present>
<c:if test="${list!=null}">
<tr class="TableLine1">
<td colspan="17" align="right">
<input type="hidden" name="page" value="${fenye.nowpage }"/>
<input type="hidden" name="shijian" value="${shijian }"/>
<input type="hidden" name="gongsi" value="${gongsi }"/>
共有${fenye.pagecount} 页||现在是第${fenye.nowpage}页||共有${fenye.allcount
}条记录
<c:if test="${fenye.nowpage!=1}">
<a
href="${pageContext.request.contextPath}/jihuafenpei.do?method=findByTimeandCom&&page=1&&danqianriqi=${shijian}&&yunshugongsi=${gongsi}">首页</a>
<a
href="${pageContext.request.contextPath}/jihuafenpei.do?method=findByTimeandCom&&page=${fenye.nowpage-1}&&danqianriqi=${shijian}&&yunshugongsi=${gongsi}">上一页</a>
</c:if>
<c:if test="${fenye.nowpage!=fenye.pagecount}">
<a
href="${pageContext.request.contextPath}/jihuafenpei.do?method=findByTimeandCom&&page=${fenye.nowpage+1}&&danqianriqi=${shijian}&&yunshugongsi=${gongsi}">下一页</a>
<a
href="${pageContext.request.contextPath}/jihuafenpei.do?method=findByTimeandCom&&page=${fenye.pagecount}&&danqianriqi=${shijian}&&yunshugongsi=${gongsi}">尾页</a>
</c:if>
</td>
</tr>
</c:if>
</table>
</html:form>
</body>
</html>
gx2425030
2009-03-25
打赏
举报
回复
子窗口代码
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>填写车牌号</title>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function check(){
document.form1.submit();
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow){
window.opener.progressWindow.close();
}
window.close();
}
</script>
</head>
<body>
<form action="jihuafenpei.do?method=AmendNumPlate" method="post" name="form1">
<input type="hidden" name="idbiaoshi" value="<%=request.getParameter("id") %>"/>
<input type="hidden" name="page" value="<%=request.getParameter("page") %>">
<input type="hidden" name="danqianriqi" value="<%=request.getParameter("shijian") %>">
<input type="hidden" name="yunshugongsi" value="<%=request.getParameter("gongsi") %>">
<table align="center">
<tr>
<td><input type="text" name="cifatianshu" /></td>
</tr>
<tr>
<td><input type="button" name="button" value="提交" onclick="check()"/></td>
</tr>
</table>
</form>
</body>
</html>
ouyangxiaokang6
2009-03-25
打赏
举报
回复
子窗口的提交的时候,是不是list没有提交呀。导致list没有更新。
你怎么写的,上代码
gx2425030
2009-03-25
打赏
举报
回复
我用的方法是,修改的时候跳出子窗口,然后点击子窗口的提交,关闭子窗口然后刷新父窗口
sjkof
2009-03-25
打赏
举报
回复
你用的什么办法来跳转的?
如何在
循环
中删除
List
集合中的元素
博客介绍了
List
删除元素的不同
循环
方法及对应
问题
的解决策略。for
循环
删除元素会因size
更新
导致漏删,可通过break或index回退解决;foreach
循环
删除元素会报并发异常,删除一个元素时可直接break;使用Iterator是最优解决方法。
vue
循环
list
数据_组件呈现函数中可能有无限
更新
循环
当在Vue组件的渲染函数中出现无限
更新
循环
警告时,通常是因为在
循环
内部修改了
循环
对象导致的。作者在排查一周后发现,
问题
源于在v-for
循环
内调用方法并修改了数组属性,这在接收到后端返回的多值tag字符串时发生。解决方案是对字符串进行处理,以逗号为分隔插入到新的数组中,避免在
循环
内部修改数据。
List
循环
类的赋值的相关
问题
本文探讨了在Java中使用
循环
为
List
赋值时遇到的一个常见陷阱,即所有元素指向同一对象实例导致的属性同步修改
问题
。通过示例代码解释了为何在
循环
结束后,即使改变了user对象的属性值,
List
内的所有元素属性也会随之
更新
。
Mybatis foreach
LIst
<Map<String,Object>>
循环
更新
本文介绍了如何在MyBatis中使用Map和
List
作为参数进行批量
更新
操作,包括@Param注解的使用和XML映射文件中的Foreach标签配置。同时,提到了批量
更新
时可能遇到的数据库连接不支持多条语句的
问题
,解决办法是在URL中添加&allowMultiQueries=true。
pythonfor
循环
遍历
list
_python3
list
使用 for 遍历,边
循环
边删除
问题
本文探讨了在Python中遍历并删除
List
元素时遇到的
问题
,分析了原因,并提供了一种解决方案。
Web 开发
81,111
社区成员
341,727
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章