Foros de discusión

Liferay.Util.Window.getWindow unable to set window size

thumbnail
Dave Weitzel, modificado hace 9 años.

Liferay.Util.Window.getWindow unable to set window size

Regular Member Mensajes: 208 Fecha de incorporación: 18/11/09 Mensajes recientes
I am using Liferay.Util.Window.getWindow() in order to generate a piop up window with web content in it.

the default size seems to be set at 95% of the available window but I cannot override this in the parameters I pass toe the method.
Looking at the source I am not sure anything would get passed through either

  I have tried the following:

function popup(thisurl) {
         Liferay.Util.Window.getWindow(
                 {
                        centered: true,
                        constrain2view: true,
                        modal: true,
                        resizable: false,
                        title:'Notification detail',
                        width: 250,
                        height:100
                }
                ).plug(
                    A.Plugin.IO,
                    {
                         uri: thisurl
                    }
                ).render();
 
    }

    popup(myurl + url);

Also I have tried :
width: 250,
height: 100,
autoHeight:true,
autoWidth:true,
autoHeightRatio: 0.5,
autoWidthRation: 0.5

Is there a problem in resizing pop up windows?

Is there an alternative way of doing pop ups in 6.2?
Is there an API definition? - I don't think constrain2view or centered have any effect but was copying from other code.

I am calling this form an Application Display Template listing recent web content articles.

Thanks
thumbnail
Suresh Nimmakayala, modificado hace 9 años.

RE: Liferay.Util.Window.getWindow unable to set window size

Liferay Master Mensajes: 690 Fecha de incorporación: 18/08/04 Mensajes recientes
Hi Dave,
in 6.2 it work like this

try something like below

create a url yourURL

PortletURL yourURL= renderResponse.createRenderURL();

set parameters if any
yourURL.setParameter("your key","value")

String popup = "javascript:Liferay.ABC.popup('"+yourURL.toString()+"')";




<liferay-ui:icon image="find" message="'Notification Details" url="<%= popup %>" />




<aui:script>
Liferay.namespace('ABC');
Liferay.provide(
Liferay.ABC,
'popup',
function(url) {
var A = AUI();

var data = {};

var dialog = Liferay.Util.Window.getWindow(
{
dialog: {
cache: false,
centered: true,
destroyOnClose: true,
destroyOnHide: true,
draggable: false,
height: 300,
width: 300,
resizable: false,
modal: true},
title: 'Notification detail',
buttons: [{
label: 'Close',
text: 'Close',
on: {
click: function() {
dialog.hide();
}}
}]
}
).render();

dialog.plug(
A.Plugin.IO,
{
data: data,
uri: url
}
);

},
['aui-base','aui-dialog','aui-io-deprecated','liferay-util-window']
);
</aui:script>