Open in the same popup broswer window
769486Feb 20 2011 — edited Apr 8 2013I have tried in JDev11.1.1.4.0 and JDev11.1.1.2.
When the user click a button, first I want to do some actions, then launch a new broswer window (not a adf popup or dialog, just a new IE broswer window). If the user click the button again, i want to make sure I am using the same launched window. Below is the code:
1) <af:commandButton text="Generate Document"
actionListener="#{actionBean.CommandLink_Clicked}"
2) In the action bean:
public void CommandLink_Clicked(ActionEvent actionEvent) {
// do something .................
// launch/re-use same browser using javscript
ExtendedRenderKitService erks =
Service.getService(ctx.getRenderKit(), ExtendedRenderKitService.class);
//this should make the url launch in the same window
String url = "window.open('http://www.google.com','samewindow');";
erks.addScript(FacesContext.getCurrentInstance(),url);
}
If the url is non-adf application url, such as: google.com, yahoo.com etc, everything would work as expected. However if the url is another adf appliction, such as: http://127.0.0.1:7101/Application-context-root/faces/test.jspx. Then a new window would be launched each time, without reusing the same popup window. I could aslo reproduce this behavior using goLink, set targetFrame="same" destination="http://127.0.0.1:7101/adf/sample.jspx".
Am I missing something? Is there a way to achieve the bahavior that I wanted?
Thanks