Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Alain Dresse
css in Liferay.Util.openWindow
November 12, 2012 7:14 AM
Answer

Alain Dresse

Rank: Junior Member

Posts: 95

Join Date: July 18, 2011

Recent Posts

Hi,

I would like to display one of my portlets in a popup. The code I used (adjusted from ) indeed puts the portlet in a dialog, but none of the css files from my portlet or from the theme are added to the head in the frame, and I don't see how to add them.

Could anybody help ?

Many thanks,
Alain

Code:
 1
 2function popupPortlet(popupTitle, portletId, parameterMap, widthPercent, heightPercent){
 3    AUI().ready('aui-dialog','aui-dialog-iframe','liferay-portlet-url','liferay-util-window', function(A) {
 4        var url = Liferay.PortletURL.createRenderURL();
 5        url.setPortletId(portletId);
 6        url.setWindowState('exclusive');
 7   
 8        for (var parameter in parameterMap){
 9            url.setParameter(parameter, paramterMap[parameter]);
10        }
11       
12        if (!widthPercent) widthPercent = 0.95;
13        if (!heightPercent) heightPercent = 0.8;
14
15        window.portletDialog = new A.Dialog(
16            {
17                title: popupTitle,
18                draggable: true,
19                resizable: true,
20                centered: true,
21                cssClass: 'bamboost-portlet-popup',
22                height: A.one("body").get("winHeight") * widthPercent,
23                width: A.one("body").get("winWidth") * heightPercent,
24                constrain2view: true,
25                modal: true
26            }
27        ).plug(
28            A.Plugin.DialogIframe,
29            {
30                uri: url.toString(),
31                iframeCssClass: 'dialog-iframe'
32            }
33        ).render();
34    });
35}
richard naoufal
RE: css in Liferay.Util.openWindow
June 25, 2013 1:57 AM
Answer

richard naoufal

Rank: Junior Member

Posts: 34

Join Date: April 4, 2013

Recent Posts

Did you manage to solve that issue ?
Aleix Casagolda
RE: css in Liferay.Util.openWindow
September 24, 2013 8:28 AM
Answer

Aleix Casagolda

Rank: New Member

Posts: 9

Join Date: June 14, 2013

Recent Posts

I guess that you have already found a solution for the problem but if somebody has the same issue, you can use the WindowState "POP_UP" (LiferayWindowState.POP_UP) instead of exclusive. The POP_UP state has the same behaviour (it returns only the portlet html, not the entire portal) but it includes the css.