Opening portlet in popup
Sometimes, we may get requirements to open portlet in a popup. We can use below Javascrpit function to open in apopup.
AUI().use('aui-base','aui-component','aui-parse-content','aui-node','liferay-form',
'liferay-portlet-url', 'liferay-util-window', 'plugin','aui-io-request', function(A){
var renderURL = Liferay.PortletURL.createRenderURL();
renderURL .setWindowState("exclusive");
renderURL.setPortletId("<portlet-name>");
var url = renderURL.toString();
A.io.request(url, {
on: {
success: function(event, id, obj) {
var responseData = this.get('responseData');
if (responseData) {
Liferay.Util.openWindow({
dialog: {
after: {
destroy: function(event) {
}
},
destroyOnHide: true,
cache: false,
centered: true,
modal: true,
resizable: false,
'toolbars.header': [
{
cssClass: 'icon-close',
label: 'close ',
visible:true,
on: {
click: function() {
Liferay.Util.getWindow('popupId').destroy();
}
}
}
],
},
id: 'popupId',
title: 'This is title',
},
function(dialogWindow) {
var bodyNode = dialogWindow.bodyNode;
bodyNode.plug(A.Plugin.ParseContent);
bodyNode.setContent(responseData);
}
);
}else{
// Else logic
}
},
failure: function() {
// failure logic
}
}
});
});
This below code will ensure to execute the render method of a portlet to be open in the popup.
var renderURL = Liferay.PortletURL.createRenderURL();
renderURL .setWindowState("exclusive");
renderURL.setPortletId("<portlet-name>");
var url = renderURL.toString();
In renderURL.setPortletId() we need to input portletname.
tempcel0tioka Diana Koroma https://wakelet.com/wake/kj_GspqKmg_aMHVOTcK5N
ReplyDeletebipymorgeo
tremunstirki_Tucson Wewere Tucson Download Free
ReplyDeleteThere
diotrucuntab
C'est un excellent tutoriel. Liferays offre des fonctionnalités étonnantes et nouvelles. Merci d'avoir partagé. Nous proposons également des services Liferay Java. Contactez-nous pour obtenir plus de détails
ReplyDelete