关于list循环到前台更新不了的问题

gx2425030 2009-03-25 01:12:59
我在jsp前台循环出list,把list其中的一条记录修改后提交,然后在跳回该jsp页面但是跳回来还是修改前的记录,没有返回修改后的list。
...全文
125 5 打赏 收藏 转发到动态 举报
写回复
用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
  • 打赏
  • 举报
回复
你用的什么办法来跳转的?

81,111

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧