我有一个在utility.js 文件中调用函数getModify() 的jsp 页面。该函数执行某些操作并使用 window.open() 将某些值重定向到下一个 jsp 页面。正在获取另一个 jsp 页面作为弹出窗口。如何获取屏幕的弹出窗口中心。
我的jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="script/Utility.js" data-dojo-config="parseOnLoad: true"></script>
</head>
<body>
<div dojotype="dijit.MenuBarItem" id="SearchMenu21" onclick="getModify();" style="font-size:11pt;" title="menuBarItem">
<img class="images" id="SearchMenu21" name="search5.png" onclick="setImgProperty(this.id)" src="images/uploads/search.png" style="height:20px; width:20px;">
Modify
</div>
</body>
</html>
这是我的 utility.js 文件:
function getModify(){
var whereCondn = "";
//alert(gbshowgridFlag);
if(dijit.byId('dynamicgridCWPROCESS')){
var selctedItem = dijit.byId('dynamicgridCWPROCESS').selection.getSelected();
if(selctedItem.length){
dojo.forEach(selctedItem, function(selectedItem){
if(selectedItem !== null){
dojo.forEach(dijit.byId('dynamicgridCWPROCESS').store.getAttributes(selectedItem), function(attribute){
var value = dijit.byId('dynamicgridCWPROCESS').store.getValues(selectedItem, attribute);
//alert(value);
if(attribute == "PROCESS_ID"){
whereCondn = whereCondn+attribute+"="+value;
}
//alert("new alert"+whereCondn);
window.open("modifyTask.jsp?MODIFY="+response,'title','height=600px,width=800px,scrollbars=no,sizable=yes,toolbar=no,statusbar=no');
});
}
});
//alert("grid row selected");
}else{
alert("grid row not selected");
}
}
if(gbshowgridFlag==false){
alert("grid not loaded");
}
}