I am using JSF to build a site. I have included jQuery Gritter (Growl) notification on my home page. Is it possible to call a managed bean method inside the before_close:
of $.gritter.add
function?
The code that I want to use is as follows:
<h:body>
<c:forEach items="#{notificationBean.growlNotificationList}" var="p">
<script>
/* <![CDATA[ */
$.gritter.add({
// (string | mandatory) the heading of the notification
title: 'Notification',
// (string | mandatory) the text inside the notification
text: 'Comment on your staus',
// (bool | optional) if you want it to fade out on its own or just sit there
sticky: true,
// (int | optional) the time you want it to be alive for before fading out (milliseconds)
time: 8000,
// (string | optional) the class name you want to apply directly to the notification for custom styling
class_name: 'gritter-light',
// (function | optional) function called before it closes
before_close: function(e, manual_close){
'#{notificationBean.set0ToGrowlToShow(p.notificationID)}'
}
});
/* ]]> */
</script>
</c:forEach>
</h:body>