【发布时间】:2026-01-25 06:15:02
【问题描述】:
单击 p:commandButton 以显示 p:dialog 时出现 javacript 错误。
请找出以下错误:
Message: Object doesn't support this property or method
Line: 1
Char: 169
Code: 0
URI: http://localhost:8080/idm/javax.faces.resource/dialog/dialog.js.xhtml? ln=primefaces&v=2.2.1
Message: Object doesn't support this property or method
Line: 1
Char: 133
Code: 0
URI: http://localhost:8080/idm/javax.faces.resource/button/button.js.xhtml?ln=primefaces&v=2.2.1
这里是代码块:
<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:p="http://primefaces.prime.com.tr/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<p:commandButton value="save" onclick="dlg1.show();" ></p:commandButton>
<p:dialog id="basicDialog" header="Basic Dialog" widgetVar="dlg1">
<h:outputText value="Resistance to PrimeFaces is futile!" />
</p:dialog>
</ui:composition>
所有其他 primefaces 组件都工作正常。
任何帮助将不胜感激。
【问题讨论】:
-
这是一个旧的和现有的 web 应用程序,还是您刚刚开始使用 PrimeFaces? 2.2.1 是一个非常古老的版本,不建议开始使用过时的库。至于问题,您是否手动包含另一个 jQuery 副本左右?
-
是的,我们使用的是 PrimeFaces 2.2.1 版本。我们只能使用这个版本来开发我们的应用程序。是的,我们正在使用 jQuery 的另一个副本,但我们想知道我们需要更改哪个文件来显示 primefaces 对话框......你能帮我解决这个问题吗?
标签: javascript jsf primefaces facelets