This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 9, 2011, 10:35 AM
16 Posts

Re: 8.5.1 and Window.close()

  • Category: Other
  • Platform: Windows
  • Release: 8.5.1
  • Role: Developer
  • Tags: window.close() in 8.5.1
  • Replies: 3
In 8.5.1, I have an script block that has the following code in it
 
dojo.addOnLoad( function(){
 dojo.connect( document, 'keydown', function(e){ 
       if(e.keyCode === 27)
       {
 
       window.location.replace(your path to go to);
       };
 }) ;
 
});
 
This works quite nicely when the user presses the escape key in the Notes client
Mar 10, 2011, 4:52 AM
13 Posts
Re: 8.5.1 and Window.close()
Thanks Mike,
 
Actually I was looking out for simulating esc key press programatically so page will close automatically on launch,so piece of code in dojo,dijit or modification in the one I provided(but its not working as expected)  is what i am trying for. 
Mar 10, 2011, 5:52 PM
64 Posts
You want the page to close on launch?
- If so then close it in onLoad.  (grin)  ESC processing isn't required.
 
- If you want ESC processing in your window then Mike's suggestion should be the ticket.

- If you want ESC processing in some particular place then Mike's suggestion is still the ticket.  The difference is the dojo.connect should be applied to whatever DOM element you want the ESC processing on.  For instance, I have similar code that attaches an event handler to a dijit underlay, so ESC will dismiss the current dialog.  Works a treat.
 
EDIT: I see now this is a repost of a prior question where you want window.close to close the MAIN window.  You can't.  This has not one thing to do with XPages, any version.  It's a browser issue.  You can close dependent pop-up windows all day with window.close(), but it's impossible to FORCE the main window to close.  Only the user can do that.
 
Hope this helps...

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal