Foren
How to close PopUp portlet
samuel Moreno, geändert vor 9 Jahren.
How to close PopUp portlet
New Member Beiträge: 14 Beitrittsdatum: 19.12.13 Neueste Beiträge
Hi,
I have a popup portlet opened by this way:
Now, i need to close this popuportlet. I've tried with this code, but i don't know what's dialogId value. With the id portlet fails...
Any suggestion?
Thanks,
Samuel.
I have a popup portlet opened by this way:
<script>
2 function callPortletPopUp(w, h, tipoPopup) {
3
4 AUI()
5 .use(
6 'aui-base',
7 'aui-io-plugin-deprecated',
8 'liferay-util-window',
9 'liferay-portlet-url',
10 'aui-dialog-iframe-deprecated',
11 function(A) {
12 var url = Liferay.PortletURL.createRenderURL();
13 url
14 .setPortletId("[PortletName]");
15 url.setParameter("tipoPopup", tipoPopup);
16 url.setWindowState('pop_up');
17 var popUpWindow = Liferay.Util.Window
18 .getWindow({
19 dialog : {
20 centered : true,
21 constrain2view : true,
22 cssClass : 'main.css',
23 modal : true,
24 resizable : false,
25 width : w,
26 height : h
27 }
28 }).plug(A.Plugin.DialogIframe, {
29 autoLoad : false,
30 iframeCssClass : 'dialog-iframe',
31 uri : url.toString()
32 }).render();
33 popUpWindow.show();
34 popUpWindow.io.start();
35 });
36
37 }
38
39
40 </script>
Now, i need to close this popuportlet. I've tried with this code, but i don't know what's dialogId value. With the id portlet fails...
function closePopUp() {
AUI().use('aui-base', 'aui-io-plugin-deprecated',
'liferay-util-window', 'liferay-portlet-url',
'aui-dialog-iframe-deprecated', function(A) {
var dialog = Liferay.Util.Window.getById(dialogId);
dialog.destroy();
});
}
Any suggestion?
Thanks,
Samuel.