我试图使用<p:overlayPanel>
作为小部件,如PrimeFaces展示示例(http://www.primefaces.org/showcase/ui/overlay/overlayPanel.xhtml)中所述。PrimeFaces OverlayPanel导致JavaScript错误“TypeError:f未定义”
我建立一个简单的应用程序,但在页加载它直接导致了JavaScript错误TypeError: f is undefined
在第3栏,行1457中的“/javax.faces.resource/primefaces.js.xhtml?ln=primefaces & V = 5.1”
的XHTML体的代码是:
<h:form id="form">
<p:commandButton update=":form:infoPanel" oncomplete="PF('testOverlayPanel').show('#{component.clientId}')" value="Test"/>
<p:overlayPanel widgetVar="testOverlayPanel" dismissable="false" showCloseIcon="true">
<p:outputPanel id="infoPanel" style="text-align:center;">
Hello OverlayPanel!
</p:outputPanel>
</p:overlayPanel>
</h:form>
当我删除了overlayPanel时,JavaScript错误消失。
当我按命令按钮,另外两个JavaScript错误出现:
- NetworkError:403禁止 - https://localhost:8443/test/index.xhtml
- 类型错误:PF(...)是未定义
我使用PrimeFaces 5.1和JSF 2.2.8
你有h:头,h:身体等吗? – 2015-02-06 15:07:44
@Jaqen:很可能,否则'primefaces.js'不会首先加载。 – BalusC 2015-02-06 15:12:42
也想过,但谁知道:-) – 2015-02-06 15:14:03