JSF h:button or Primefaces p:button - target _blank

后端 未结 3 1392
挽巷
挽巷 2020-12-19 16:17

How can I set _blank as target of a h:button or p:button?

Right now I have a simple link:



        
相关标签:
3条回答
  • 2020-12-19 16:54

    add ajax="false" to primefaces commandButton

    0 讨论(0)
  • 2020-12-19 17:11

    I used :

    <h:form target="_blank">
          <p:commandButton value="Run" action="#{bean.createReport}"  />
        </h:form>
    

    and this is ok.

    0 讨论(0)
  • 2020-12-19 17:16

    A little javascript will help:

    <p:button value="Link" onclick="window.open('#{bean.url}'); return false;" />
    

    The EL expression will be replaced before javascript is executed.

    0 讨论(0)
提交回复
热议问题