Using following code stuff can easily launch a new page.
import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
import org.apache.myfaces.trinidad.util.Service;
public void launchNewPage() {
String newPage = "http://www.google.com";
FacesContext ctx = FacesContext.getCurrentInstance();
ExtendedRenderKitService erks =
Service.getService(ctx.getRenderKit(), ExtendedRenderKitService.class);
String url = "window.open('" + newPage + "','_self');";
erks.addScript(FacesContext.getCurrentInstance(), url);
}
No comments:
Post a Comment