0
我在我的應用程序定義此鏈接:打開對話框PrimeFaces wihout的commandButton
<a href="${request.contextPath}/pages/help/applicationHelpVersion.jsf" title="#{msg['menu.version']}" onclick="window.open(this.href, 'applicationHelpVersion','left=20,top=20,width=400,height=300,toolbar=0,resizable=1'); return false;">#{msg['menu.version']}</a>
該解決方案將打開當前的應用版本號新的瀏覽器窗口。
我想重新定義它,以便新的對話窗口打開。
我使用primefaces,並有模態對話框我想使用,但它與所有示例中的commandButton相結合。
這裏是applicationHelpVersion.xhtml:
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:hr="http://java.sun.com/jsf/html"
template="/layout/helpLayout.xhtml">
<ui:define name="insert-application-content">
<div style="text-align:center">
<h1><h:outputText value="version: "/><span class="applicationVersionContent">${versionContext.productVersion}</span></h1>
<!--<h1><h:outputText value="stage: "/><span class="applicationVersionContent">${versionContext.productNameExtension}</span></h1>-->
</div>
</ui:define>
</ui:composition>
能否請你幫我如何打開新的模態對話框與應用程序的版本?我試過這樣的事情:
<a href="${request.contextPath}/pages/help/applicationHelpVersion.jsf" title="#{msg['menu.version']}" onclick="PF('dlg1').show();">return false;">#{msg['menu.version']}</a>
<p:dialog header="Modal Dialog" widgetVar="dlg2" modal="true" height="100">
<h:outputText value="here will be version of app..."/>
</p:dialog>
我真的不知道在這裏設置href參數或者如果可以這樣做。在此狀態下,應用程序版本將顯示在新的.jsf頁面中,但我需要對話窗口。你能幫我麼?謝謝。
您可以使用'
'' – Holger