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.
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.
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 --> <!--
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.
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.
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With