按钮单击时,Primefaces在新选项卡中打开页面

时间:2016-12-08 05:08:03

标签: jsf primefaces

我有这个

<h:outputLink value="http://.....index.html"
target="_blank">open</h:outputLink>

但它显示像链接。我怎样才能创建这个按钮?我需要按钮&#34;打开&#34;。当我按下此按钮时,我需要在浏览器的新选项卡中打开我的链接。

2 个答案:

答案 0 :(得分:12)

请提及您的PF版本我们也使用如下,它适用于旧版本试试让我们知道

<p:button  value="Open" href="http://.....index.html" target="_blank" />

答案 1 :(得分:-2)

您可以使用<p:button><p:commandButton>:

执行以下两种方式之一
<p:commandButton value="Open" action="index.html" ....other optional attributes/>

<p:button value="Open" outcome="http://.....index.html" >
相关问题