作者: kent鹏
转载请注明出处:
linkman/list.jsp:
立即学习“Java免费学习笔记(深入)”;
<input type="button" value="选择客户" onclick="window.open('${pageContext.request.contextPath}/CustomerAction_list?select=true','','width=600,height=300')" />
coustomer/list.jsp
function selectCustomer(cust_id,cust_name){//获得添加页面的window对象var win = window.opener;//获得添加页面的document对象var doc = win.document;//获得隐藏域,和 文本框,并赋值doc.getElementById("cust_id").value=cust_id; doc.getElementById("cust_name").value=cust_name;//关闭当前窗口 window.close(); };
<s:if test="#parameters.select==null"><a href="${pageContext.request.contextPath }/CustomerAction_toEdit?cust_id=<s:property value="#cust.cust_id" />">修改</a> <a href="${pageContext.request.contextPath }/customerServlet?method=delete&custId=${customer.cust_id}">删除</a></s:if><s:else><input type="button" value="选择" onclick="selectCustomer(<s:property value="#cust.cust_id" />,'<s:property value="#cust.cust_name" />')" /></s:else>
注:后台使用同一个方法完成添加和更新功能
以上就是JAVAEE--联系人添加、列表显示和修改功能的详细内容,更多请关注php中文网其它相关文章!
java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号