Author: kentpeng
Please indicate the source for reprinting:
linkman/list.jsp:
<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>
2. Contact list
3. Contact modification
The above is the detailed content of JAVAEE--contact addition, list display and modification functions. For more information, please follow other related articles on the PHP Chinese website!