- 打開子窗口我有一個父窗口worklist.jsp命名爲
- 父窗口有一個按鈕。點擊按鈕後,它會調用一個名爲getEventLogUser()的函數。
- getEventLogUser()函數輪流調用一個名爲popupWindowWithPost()的函數,該函數打開子窗口。這兩個函數是在單獨的js文件(utility.js)..
- 我的需要是,我必須禁用父窗口時打開子。
worklist.jsp:禁用父窗口使用JavaScript
<div class="claro" id="menuDiv21" onclick="setWidgetproperty(this.id,'x','navMenu21');" onmousedown="setMenuBarProperty('navMenu21');" onmouseup="setDocStyle(this.id)" style="border:1px dotted white; left: auto; position: absolute; top: 620px;">
<div dojotype="dijit.MenuBar" id="navMenu21" style="font-size:11pt;" title="MenuBar">
<div dojotype="dijit.MenuBarItem" id="SearchMenu21" onclick="getEventLogUser();setMenuId(this.id);" 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;">
Search
</div>
</div>
</div>
utility.js:
function getEventLogUser(){
var dummyvar = document.getElementById("CWPROCESSEVENTLOG.OBJECT_ID").value;
popupWindowWithPost("eventLogUser.jsp",'height=600px,width=960px,top=50px,left=150px,scrollbars=no,sizable=yes,toolbar=no,statusbar=no','processManager',dummyvar);
}
function popupWindowWithPost(url, windowoption, name, params)
{
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", url);
form.setAttribute("target", name);
var input = document.createElement('input');
input.type = 'hidden';
input.name = "PARAM";
input.value = params;
form.appendChild(input);
document.body.appendChild(form);
window.open(url, name, windowoption);
form.submit();
document.body.removeChild(form);
}
當你說'禁用'父窗口..你的意思是用戶不能點擊它的任何東西?即如果他們在子窗口打開時點擊父窗口中的按鈕,該按鈕將不會響應? – abbood 2013-02-15 05:03:06
是的......當孩子打開時,在父窗口中不應該沒有動作... – Rachel 2013-02-15 05:05:37
Rachel請讓我們知道我們的答案是否符合您的需求,或者爲什麼不這樣做,以便我們可以幫助你 – abbood 2013-02-15 05:19:49