【问题标题】:p:dialog typeerror-pf-is-undefined when trying to show using widgetvar [duplicate]p:dialog typeerror-pf-is-undefined 尝试使用 widgetvar 显示时 [重复]
【发布时间】:2015-11-09 09:35:35
【问题描述】:

我正在尝试显示来自网页或 bean 的对话框。无论哪种情况,它都会出现上述错误,并且似乎无法在 PF 中找到该组件。我正在使用 PrimeFaces 5.2,我似乎没有讨论过 here

的多版本问题

我在下面粘贴了相关的 xhtml 代码 - 当我尝试从 bean 调用它时会发生完全相同的行为:

RequestContext.getCurrentInstance().execute("PF('dlgTask').show();");
    <ui:composition template="template-restricted.xhtml">
        <ui:define name="body_content">
                <div id="title" class="sl-title">#{text['project.title']}   </div>
                <p:dialog
                    id="taskDialog"
                    widgetVar="dlgTask" 
                    modal="true"
                    closeOnEscape="true">
                <h:form id="taskDialogForm">
                    <p:panelGrid columns="1" layout="grid">
                        <p:outputLabel for="taskName" value="#{text['name']}" />
                        <p:inputText 
                            id="taskName" 
                            value="#{editProject.editTask.name}" />
                    </p:panelGrid>
                </h:form>
                </p:dialog>
                <p:commandButton      
                    title="#{text['project.task.new']}"
                    disabled="#{not editProject.canEditProject}"
                    action="#{editProject.createNewTask}"
                    process="@form"
                    update="@form"
                    oncomplete="PF('dlgTask').show();"
                    icon="fa fa-plus" />

【问题讨论】:

    标签: jsf primefaces dialog widget


    【解决方案1】:

    这是由声明 jquery.js 库的菜单部分中不相关的 javascript 引起的。当我删除有问题的导入时,所有奇怪的 Primefaces 错误都消失了。似乎声明其他 jquery 库会干扰 Primefaces 代码。

    【讨论】:

      猜你喜欢
      • 2014-03-14
      • 2018-05-10
      • 1970-01-01
      • 2020-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多