答案 0 :(得分:0)
(我认为Piyush现在必须已经解决了该问题,并且在其他人遇到相同问题的情况下将其发布。)
您需要导入liferay-notification js模块才能使用Liferay通知。 例如:
<aui:script use="liferay-notification">
new Liferay.Notification({
closeable: true,
delay: {
hide: 3000,
show: 0,
},
duration: 500,
message: message,
title: 'Your success Message',
type: 'success'
//danger, warning and info also exists
}).render();
</aui:script>
另一种方法是:
<script type="text/javascript">
AUI().use('liferay-notification', function(A) {
new Liferay.Notification({
closeable: true,
delay: {
hide: 10000,
show: 0
},
duration: 500,
message: message,
render: true,
title: 'your success message',
type: 'success'
}).render('body');
});
</script>