问题描述
我尝试了PrimeFaces的示例,但它没有用。我得到以下JS错误:
I tried the NotificationBar example of PrimeFaces, however it didn't work. I get the following JS error:
我想在使用 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" />
这篇关于ReferenceError:未定义PF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!