繁体   English   中英

a4j:commandLink检查onComplete后打开一个新选项卡

[英]a4j:commandLink open a new tab after checking onComplete

有没有一种方法可以使用a4j:commandLink中的“不完整”来打开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。

您可以这样做:

<a4j:commandLink action="#{dashBoardBean.visualizarDocumento}" update="@this" 
    oncomplete="window.open('yourNewPage.xhtml', '#{dashBoardBean.possuiDocumento ? '_blank' : '_self'}')">
</a4j:commandLink>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM