I try to to open a window with context.execute.
In my viewbean I have the folloing code. When I execute this method with a commandlink action the alert shows but not the new window.
Code: Select all
<p:commandLink value="Open Window" action="#{applicationPage.openWindow()}" oncomplete="PF('dlg1').show()" immediate="true" >
</p:commandLink>
Code: Select all
public void openWindow(){
RequestContext context = RequestContext.getCurrentInstance();
context.execute("window.open('http://www.orf.at');");
context.execute("alert('http://www.orf.at');");
}
Code: Select all
<p:commandLink value="Open Window" onclick="window.open('http://www.orf.at')"
oncomplete="PF('dlg1').show()" immediate="true" >
</p:commandLink>
I'm using Payara 4.1.1.162, Primefaces 6.0, Deltaspike 1.6 and Firefox 48/Chrome 52
br
Thomas