showModalDialog技术
通过showModalDialog打开一个窗口,在当前窗口中不能进行鼠标“右击”操作,并且传递参数(字符串、数组)可以不用在url进行拼接传递,关于showModalDialog的说明网上有很多说明,这里就不做具体说明,请看下面实例:1、在role-binding-add.jsp中的js方法中有如下代码:
Javascript代码
var allInfo=new Array(2);
allInfo = document.forms.userIds.value;
allInfo = document.forms.peopleSearchCondition.value;
//可以传递数组
var result = showModalDialog
("${pageContext.request.contextPath}/cbice/subsystem/unifiedroleadmin/select-no-center-people.jsp?selectType=muti",allInfo, "dialogWidth=800px;dialogHeight=500px;dialogLeft=200px;dialogTop=100px;status=no;");
//返回值可以是数组
if(result){
formObj.userIds.value=result;
document.forms.peopleSearchCondition.value=result;
}
var allInfo=new Array(2);
allInfo = document.forms.userIds.value;
allInfo = document.forms.peopleSearchCondition.value;
//可以传递数组
var result = showModalDialog
("${pageContext.request.contextPath}/cbice/subsystem/unifiedroleadmin/select-no-center-people.jsp?selectType=muti",allInfo, "dialogWidth=800px;dialogHeight=500px;dialogLeft=200px;dialogTop=100px;status=no;");
//返回值可以是数组
if(result){
formObj.userIds.value=result;
document.forms.peopleSearchCondition.value=result;
}
2、select-no-center-people.jsp中的js方法有如下代码:
Javascript代码
//当前方法是处理用户点击提交后,将信息保存到上一页面。
var selectOKArr = new Array(2);
window.returnValue=selectOKArr;
self.close();
页:
[1]