rich:component and rich:tooltip interaction
genrico May 22, 2012 10:00 AMHi there,
Since RichFaces' last update (4.2.2) dealing with rich:tooltip problems, the rich:tooltip is now using the Javascript Service feature from RichFaces instead of the classic Javascript implementation. My problem is that, since then, my tooltip isn't working.
I have a notification system using a4j:push that update a mail counter and notify the user with a tooltip.
Here is my notificationPanel.xhtml
<a4j:push address="notificationAddress#{uiNotifications.login}" ondataavailable="updateNotificationsInformations(event.rf.data)"> <a4j:ajax event="dataavailable" execute="@this" render="@none" /> </a4j:push> <a4j:jsFunction name="updateNotificationsInformations" execute="@this" limitRender="true" action="#{uiNotifications.updateNotifications}" oncomplete="#{rich:component('newNotificationsTooltip')}.show()" render="notificationsPanel,mailCounter,newNotificationsTooltip" > <a4j:param name="param1" assignTo="#{uiNotifications.idNotification}" /> </a4j:jsFunction>
And my tooltip is in controlNotificationsIcon.xhtml
<h:panelGroup id="newNotificationsContainer" layout="block" /> <h:form> <rich:tooltip id="newNotificationsTooltip" styleClass="tooltip" target="newNotificationsContainer" layout="block" attached="false" hideDelay="2000"> <span> Vous avez 1 nouveau message.</span> </rich:tooltip> </h:form>
On the javascript console of my browser, i have this error
Uncaught TypeError: Cannot call method 'show' of undefined (anonymous function) serverEventHandlerrichfaces.js.html:499 curryrichfaces.js.html:475 richfaces.createJSFEventsAdapterrichfaces.js.html:428 sendEventjsf.js.html:1442 responsejsf.js.html:2079 richfaces.queue.responserichfaces-queue.js.html:413 jsf.ajax.responserichfaces-queue.js.html:50 onCompletejsf.js.html:1227 req.xmlReq.onreadystatechange
Well, seems the rich:component doesn't find my tooltip, but I don't understand why. It was working perfectly in the previous versions.
Any ideas ?