【发布时间】: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