I am wanna to have notification bar in my jsf page. When I use this sample code it works
<p:notificationBar position="top" effect="slide" styleClass="top" widgetVar="notifBar">
<h:outputText value="Hi ..." style="font-size:36px;" />
</p:notificationBar>
<p:commandButton value="Show2" onclick="PF('notifBar').show();" type="button"/>
but when I use this code it doesn't work
<p:commandButton value="Show1" onclick="notifBar.show()" type="button"/>
Why and what does this PF do ? My final approach is to have auto hide notification panel, but when I used code like this
<p:commandButton value="Show2" onclick="PF('notifBar').show();setTimeout(PF('notifBar').hide, 3000)" type="button"/>
It shows this error :
Uncaught TypeError: Cannot read property 'effect' of undefined PrimeFaces.widget.NotificationBar.PrimeFaces.widget.BaseWidget.extend.hide
and by this code
<p:commandButton value="Show2" onclick="PF('notifBar').show();setTimeout(notifBar.hide, 3000)" type="button"/>
it shows
Uncaught ReferenceError: notifBaris not defined
Could anyone help me please ..