Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to close a Browser Window?

Nigel Thomas-OracleMay 29 2012 — edited May 31 2012
Hi,
I am using JDeveloper 11.1.2.1.0

I want to close the browser window on pressing a command button.
I tried this code and it is working for Internet Explorer.
FacesContext facesContext = FacesContext.getCurrentInstance();

org.apache.myfaces.trinidad.render.ExtendedRenderKitService service = org.apache.myfaces.trinidad.util.Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);

service.addScript(facesContext, "window.close();window.opener.location.href = window.opener.location.href;");
How to make this happen in Mozilla Firefox or Google Chrome?

Thanks,
Nigel.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2012
Added on May 29 2012
6 comments
693 views