PrimeFaces 5.2对话框架p:对话框widgetVar返回undefined

时间:2015-05-19 21:02:15

标签: jsf primefaces dialog undefined jsf-2.2

我正在使用Primefaces 5.2作为我的网络应用。尽管在互联网上搜索解决方案并进行了大量更改,但我仍然无法解决问题并打开对话框组件。在我搜索之后,我在我的网络应用程序中添加了以下内容:

<h:outputScript name="jquery/jquery-plugins.js" library="primefaces"/>

到我的JSF页面标题,以及下面的faces-config.xml文件。

<application>
    <action-listener>org.primefaces.application.DialogActionListener</action-listener>
    <navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
    <view-handler>org.primefaces.application.DialogViewHandler</view-handler>
</application>

当我尝试打开对话框组件时,我在浏览器控制台中收到以下错误:

Widget for var 'notifyDylg' not available!
mainPage.xhtml:356 Uncaught TypeError: Cannot read property 'show' of undefined

以下是我的xhtml页面内容:

<h:form id="contentForm" styleClass="body">
<p:commandButton id="maxMapBtnId" value="#{general.maximizeMap}" icon="ui-icon-arrow-4-diag"
    type="button" onclick="PF('notifyDylg').show();">
</p:commandButton>

<p:dialog id="notifyDylgId" header="Notification" 
    widgetVar="notifyDylg" showEffect="slide" hideEffect="blind" closeOnEscape="true">
    <h:outputText value="#{bean.notifyMessage}" />          
</p:dialog>

</h:form>

我该如何解决这个问题?

0 个答案:

没有答案