【发布时间】:2015-04-25 19:57:33
【问题描述】:
我想在我的 jsf 页面中有通知栏。当我使用此示例代码时,它可以工作
<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"/>
但是当我使用这个代码时它不起作用
<p:commandButton value="Show1" onclick="notifBar.show()" type="button"/>
这个PF为什么和做什么? 我的最终方法是自动隐藏通知面板,但是当我使用这样的代码时
<p:commandButton value="Show2" onclick="PF('notifBar').show();setTimeout(PF('notifBar').hide, 3000)" type="button"/>
它显示了这个错误:
未捕获的类型错误:无法读取未定义的属性“效果” PrimeFaces.widget.NotificationBar.PrimeFaces.widget.BaseWidget.extend.hide
通过这段代码
<p:commandButton value="Show2" onclick="PF('notifBar').show();setTimeout(notifBar.hide, 3000)" type="button"/>
它显示
未捕获的引用错误:notifBaris 未定义
谁能帮帮我..
【问题讨论】:
标签: jsf-2 primefaces