ITeye博客

JSP以Window形式打开把值从子窗体传回给父窗体 用jquery

ware · 2010-12-06 13:47 · JSP · 企业架构 · Markdown

首先在父窗体(JSP)引用

下面这个是页面跳转的JS function chooseCustomer(){ var url= "${ctx}/objection.do?method=chooseCustomer"; //转向网页的地址的Action; var name="选择客户信息"; //网页名称,可为空; var iWidth=950; //弹出窗口的宽度; var iHeight=650; //弹出窗口的高度; var iTop = (window.screen.availHeight-30-iHeight)/2; //获得窗口的垂直位置; var iLeft = (window.screen.availWidth-10-iWidth)/2; //获得窗口的水平位置; window.open(url,name,'height='+iHeight+',,innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=no,resizeable=no,location=no,status=no'); } 下面一个JS是从子窗体里调用的回调函数 //选择客户的回调函数 function chooseUserCallBack(productid,productname){ $("#CCustomerId").attr("value",productid); //CCustomerId 文体框的ID $("#fourSName").attr("value",productname); } 如:

function sele(id,name){
	CGoodsStrengthId = id;
	CGoodsStrengthName = name;
}
function checkFather(){
	if(null==CGoodsStrengthId || CGoodsStrengthId==""){
		alert("请先选择后再提交。");
		return;
	}
			window.openerWindow.chooseUserCallBack(CGoodsStrengthId,CGoodsStrengthName);
			window.close();
	
}

在单选按扭上调用sele();JS 提交的时候调用 就可以了。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。