import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
import org.apache.myfaces.trinidad.util.Service;
public void closeWindow() {
// Add event code here...
FacesContext facesContext = FacesContext.getCurrentInstance();
ExtendedRenderKitService service =
Service.getRenderKitService(facesContext,
ExtendedRenderKitService.class);
service.addScript(facesContext, "window.open('', '_self', ''); window.close();");
}
import org.apache.myfaces.trinidad.util.Service;
// Add event code here...
FacesContext facesContext = FacesContext.getCurrentInstance();
ExtendedRenderKitService service =
Service.getRenderKitService(facesContext,
ExtendedRenderKitService.class);
service.addScript(facesContext, "window.open('', '_self', ''); window.close();");
}
6 comments:
Hiee,
i have checked this code it is showing error at "Service ". What package should i add to it
Thanks got it worked.. Thankz alot dude.
This works in IE and Chorme but not in FF(v30). In FF it gives error - 'Scripts may not close windows that were not opened by script.'
Hi Vijay,
Can i know how to call above method in jspx.
Thanks in Advance.
Please let me know..
hi
i am using the above code . this code is working fine for me before login once i am login with my credentials i am not able to close the browser please suggest me
Thanks in advance
Post a Comment