I want to use omnifaces push notification which is already working for me. The only problem is that the container is not updating as soon I got a push notification. Only with a page refresh.
I would like tu update my bell icon: Bell Icon
Here my code with the strucuture... Code
Here my code JSF:
<h:form id="notificationPushTopbarForm">
<o:socket channel="notificationChannel"
user="#{loginBean.currentEmployee.id}" scope="view"
onmessage="someTestScript">
</o:socket>
<o:commandScript name="someTestScript"
actionListener="#{numberOfUnreadNotificationByEmployeeNotLazyController.findNumberOfUnreadNotification()}"
immediate="true" render="@parent:topbar_container, :notificationTopbarForm" />
</h:form>
<h:panelGroup id="topbar_container" styleClass="topbar" layout="block">
<ul class="topbar-menu">
<li><p:commandLink id="notificationLink" global="true"
update=":notificationTopbarForm" resetValues="true"
oncomplete="PF('notificationSidebar').show()" ajax="true"
process="@this">
<i class="topbar-icon fa fa-fw fa-bell-o"></i>
<h:outputText id="notificationTopbar"
value="#{numberOfUnreadNotificationByEmployeeNotLazyController.numberOf}"
rendered="#{numberOfUnreadNotificationByEmployeeNotLazyController.numberOf != 0}"
styleClass="topbar-badge animated FontBold rubberBand" />
<h:outputText value="Benachrichtungen"
styleClass="topbar-item-name" />
</p:commandLink> <p:tooltip for="notificationLink" value="Benachrichtungen"
position="bottom" /></li>
Any idea what I´m doing wrong
Change the update attribute to the following:
render=":topbar_container :notificationTopbarForm"