【发布时间】:2014-08-24 04:56:13
【问题描述】:
我有一个页面inner.xhtml 使用ui:include 包含在outer.xhtml 中。 inner.xhtml 有一个 p:commandLink,其 oncomplete 属性会打开一个 p:dialog。
inner.xhtml
<html>
<ui:composition>
<h:form>
<p:commandLink oncomplete="mydialog.show();" actionListener="listener method" process="@this">
</p:commandLink>
</h:form>
</ui:composition>
<p:dialog id="mydialogid" widgetVar="mydialog">
My Code For Dialog
</p:dialog>
</html>
outer.xhtml
<h:form>
<p:commandButton oncomplete="dlg.show();" actionListener="listener method" global="false"></p:commandButton>
</h:form>
<p:dialog id="dlgid" widgetVar="dlg" dynamic="true" appendTo="@(body)">
<ui:include src="inner.xhtml">
<ui:param name="idPrefix" value="par"/>
</ui:include>
</p:dialog>
问题是单击inner.xhtml 中的commandlink 时出现此错误
Uncaught ReferenceError: mydialog is not defined
而且对话框没有打开。如何解决这个问题?
我正在使用 primefaces 4.0
【问题讨论】:
标签: jsf-2 primefaces