我正在使用 JSF 来构建一个站点。我的主页上包含了jQuery Gritter (Growl)通知。是否可以在before_close:
of$.gritter.add
函数中调用托管 bean 方法?
我要使用的代码如下:
<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>