10

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

ReferenceError: PF is not defined

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.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
ThunderPhoenix
  • 1,649
  • 4
  • 20
  • 47

1 Answers1

21

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.

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" />  
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • 5
    I am using primeface 5.2 but not able to access PF(). do I need to include any file in javascript? – Sagar Apr 24 '15 at 14:33