Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReferenceError: PF is not defined

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.

like image 516
ThunderPhoenix Avatar asked Aug 06 '13 09:08

ThunderPhoenix


People also ask

How to solve uncaught ReferenceError-$is not defined?

Solution 1: Using before defining - Uncaught ReferenceError: $ is not defined Case: Invoking the function or using a variable before declaring it. As you are aware, all javascript code is executed inside the browser such as Chrome, Mozilla, Safari, and IE.

What does the window is not defined reference error mean?

The window is not defined reference error may also occur in case of browser execution. It can happen due to misspelled keywords or a mispositioned script tag. Let us discuss this with an example. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> </head> <body> <!-- HTML Code here --> <!--

What is a ReferenceError?

Let us look into some basics first. ReferenceError: This class of error occurs when we try to reference a variable that does not exist in the current scope or is waiting for initialization. Video Player is loading. This is a modal window.

Why is Html2Pdf is not defined not working in angular?

The html2pdf is not defined error only occurs when using the non-node version. So I'm pretty sure Angular still resolves jsPDF to the non-node file. Nevertheless, I think unconditionally accessing window is also bad, so I'm gonna mark this as bug. I tried to run jsPDF on node myself and it - kind of - works.


1 Answers

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" />  
like image 81
BalusC Avatar answered Oct 18 '22 07:10

BalusC