参考错误:PF 未定义 [英] ReferenceError: PF is not defined

查看:28
本文介绍了参考错误:PF 未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了 PrimeFaces 的 NotificationBar 示例,但它不起作用.我收到以下 JS 错误:

I tried the NotificationBar example of PrimeFaces, however it didn't work. I get the following JS error:

ReferenceError: PF 未定义

ReferenceError: PF is not defined

我想在使用 PF() 函数之前我需要包含一个库,但我不知道是哪个库以及在哪里可以找到它.

I think I need to include a library before using PF() function, but I don't know which library and where can I find it.

推荐答案

JS 函数 PF() 仅从 4.0 开始可用.您显然在使用 PF 3.x.查看展示站点的页脚,目前说它正在运行 PF 4.0.

The JS function PF() is only available since 4.0. You're apparently using PF 3.x. Look at the footer of the showcase site, it's currently saying that it's running PF 4.0.

只需使用 widgetVar.show(),其中 widgetVar 是您在 widgetVar 中指定的小部件变量名称,即 bar 在他们的展示示例中.

Just use widgetVar.show(), where widgetVar is the widget variable name as you specified in widgetVar, which is bar in their showcase example.

<p:commandButton value="Show" onclick="bar.show()" type="button" />  
<p:commandButton value="Hide" onclick="bar.hide()" type="button" />  

这篇关于参考错误:PF 未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆