Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-15-2013, 05:57 AM   PM User | #1
BobbyRachel
New Coder

 
Join Date: Dec 2012
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
BobbyRachel is an unknown quantity at this point
Disable parent window while child window is opened using javascript??

1. I have a parent window named worklist.jsp
2. Parent window has a button. on click of the button, it calls a function named getEventLogUser().
3. getEventLogUser() function in turns calls a function named popupWindowWithPost() which opens the child window. both the function is in separate js file(utility.js)..
4. My need is, i have to disable the parent window when child is opened.

worklist.jsp:

Code:
 <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:

Code:
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);
    }
BobbyRachel is offline   Reply With Quote
Old 02-15-2013, 08:25 AM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,452
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Each window is completely independent - the only way to do what you want is to put both in the same window.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 02-15-2013, 08:44 AM   PM User | #3
BobbyRachel
New Coder

 
Join Date: Dec 2012
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
BobbyRachel is an unknown quantity at this point
its not necessary to have it in same window... i achieved it from this link..
http://www.aspsnippets.com/Articles/...avaScript.aspx
BobbyRachel is offline   Reply With Quote
Old 02-15-2013, 09:15 AM   PM User | #4
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,452
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by BobbyRachel View Post
its not necessary to have it in same window... i achieved it from this link..
http://www.aspsnippets.com/Articles/...avaScript.aspx

JavaScript has changed significantly since 2009 when that script was written. Most of the browsers that allowed that script to work are now long dead.

The modal setting in that script is ignored by some browsers and can be overridden in most others. Many browsers even allow you to specifically direct window.open calls to another tab in the same window so that making that modal becomes meaningless.

The only way to ensure that it is not easily bypassed or blocked is to do it all within the one window.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Tags
javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:16 PM.


Advertisement
Log in to turn off these ads.