有没有办法使用a4j:commandLink中的“oncomplete”从h:commandLink打开一个像“target”这样的新标签? 类似的东西:
target="#{dashBoardBean.possuiDocumento ? '_blank' : '_self'}"
<a4j:commandLink action="#{dashBoardBean.visualizarDocumento}"
oncomplete="#{dashBoardBean.possuiDocumento}">
</a4j:commandLink>
现在我的代码是这样的:
<h:commandLink action="#{dashBoardBean.visualizarDocumento}"
target="#{uc.documento ? '_blank' : '_self'}">
<f:setPropertyActionListener value="#{uc}" target="#{dashBoardBean.contentTarget}" />
<de:statusContent content="#{uc}"/>
</h:commandLink>
现在我需要在操作后进行检查,然后才打开新选项卡,但是h:commanLink没有oncomplete。
答案 0 :(得分:1)
<a4j:commandLink action="#{dashBoardBean.visualizarDocumento}" update="@this"
oncomplete="window.open('yourNewPage.xhtml', '#{dashBoardBean.possuiDocumento ? '_blank' : '_self'}')">
</a4j:commandLink>