留言板
Problem to Liferay popup and refresh portlet
Andres Gonzalez,修改在9 年前。
Problem to Liferay popup and refresh portlet
New Member 帖子: 2 加入日期: 13-11-17 最近的帖子
Hello people, i have the next problem:
i have two portlets
portlet A is just for information
in portlet B i use a Liferay popup , where i make ajax call and close the popup(that works fine) but i need refresh portlet A, so i add the code Liferay.Portlet.refresh(portlet id), that works fine only the first time , in second time when i call popup, he make the ajax call and refresh the portlet but he does not close popup, i get javascript error "Cannot read property 'destroy' of undefined ";
the problem apears when i use the code "Liferay.Portlet.refresh('#p_p_id_shoppingcartlist_WAR_ImpresistemWebportlet_');"
please helpme
Thanks a lot
Sry for my bad english
here my code:
i have two portlets
portlet A is just for information
in portlet B i use a Liferay popup , where i make ajax call and close the popup(that works fine) but i need refresh portlet A, so i add the code Liferay.Portlet.refresh(portlet id), that works fine only the first time , in second time when i call popup, he make the ajax call and refresh the portlet but he does not close popup, i get javascript error "Cannot read property 'destroy' of undefined ";
the problem apears when i use the code "Liferay.Portlet.refresh('#p_p_id_shoppingcartlist_WAR_ImpresistemWebportlet_');"
please helpme
Thanks a lot
Sry for my bad english
here my code:
AUI.namespace('shopWindowContent');
AUI()
.use(
'aui-base',
'liferay-util-window',
'io',
function(A) {
AUI.shopWindowContent.close = function(resourceURL) {
var shoppingQuantity = A.one('#'+portletNamespace+'shoppingQuantity').get('value');
var ajaxRequest = A.io.request(resourceURL,{
method : 'POST',
data : {_shopwindowcontent_WAR_ImpresistemWebportlet_shoppingQuantity:shoppingQuantity},
on:{
success : function(message){
Liferay.Util
.getOpener()
.closeItemDetailsPopup(
portletNamespace + 'itemDetailsPopup');
}
}
});
ajaxRequest.start();
};
AUI.shopWindowContent.showItemDetailsPopup = function(
actionURL) {
Liferay.Util.openWindow({
dialog : {
destroyOnHide: true,
centered : true,
constrain2view : true,
cssClass : 'itemDetailsPopupCssStyle',
modal : true,
resizable : false,
width : 800,
height : 275
},
id : portletNamespace + 'itemDetailsPopup',
title : "Informacion del Producto",
autoLoad : true,
iframeCssClass : 'itemDetailsPopup-iframe',
uri : actionURL
});
};
Liferay.provide(window,'closeItemDetailsPopup',
function(dialogId) {
Liferay.Portlet.refresh('#p_p_id_shoppingcartlist_WAR_ImpresistemWebportlet_');
Liferay.Util.getWindow(dialogId).destroy();
}, [ 'liferay-util-window' ]);
});
Manali Lalaji,修改在9 年前。
RE: Problem to Liferay popup and refresh portlet
Expert 帖子: 362 加入日期: 10-3-9 最近的帖子
Andres Gonzalez,修改在9 年前。
RE: Problem to Liferay popup and refresh portlet
New Member 帖子: 2 加入日期: 13-11-17 最近的帖子
Hi ,
i've check the dialogid and is ok in Liferay.getOpener function and Liferay.provide Function
i've make the example for link2 but im still getting error "Uncaught TypeError: Cannot read property 'destroy' of undefined " when function try to close popup but this time the second time than i use the popup this does not close , seems like reset instead close.
any other idea? Please!
TY
i've check the dialogid and is ok in Liferay.getOpener function and Liferay.provide Function
i've make the example for link2 but im still getting error "Uncaught TypeError: Cannot read property 'destroy' of undefined " when function try to close popup but this time the second time than i use the popup this does not close , seems like reset instead close.
any other idea? Please!
TY