I have the following output link that does its job:
<h:outputLink value="#{verDocumentoController.url()}" target="_blank"> show document </h:outputLink>
It opens the URL obtained as the bean property in a new window.
However, I would like to turn the link into a button in PrimeFaces look'n'feel. I tried as below:
<p:commandButton value="show document" action="#{verDocumentoController.url()}" onclick="form.target='_blank'" ajax="false" />
But it only reopens the current page in a new window, and not the URL specified as a bean property. How can I achieve this?
source share