Wednesday, January 12, 2011

Liferay Alloy Popup

In Liferay's previous versions, we are using Liferay.Popup for popup window using jQuery.

As Liferay is moved to Alloy UI , Here is the code for Alloy Popup:


To Display some Html content in Alloy Popup:


< aui:script >

function callPopup(){

AUI().ready('aui-dialog', 'aui-overlay-manager', 'dd-constrain', function(A) {

var dialog = new A.Dialog({

title: 'DISPLAY CONTENT',

centered: true,

modal: true,

width: 500,

height: 400,

bodyContent: "This is testing content inside the popup"

}).render();

});

}

</aui:script >




Passing URL : Passing URL into Alloy Popup

<aui:script>

Liferay.provide(window,'<portlet:namespace />callPopup',

function(url1) {

var A = AUI();

var data = {};

var dialog = new A.Dialog(

{

centered: true,

destroyOnClose: true,

modal: true,

title: Liferay.Language.get('Display-Content'),

width: 600

}

).render();

dialog.plug(

A.Plugin.IO,

{

data: data,

uri: url1

}

);

},

['aui-dialog', 'aui-io']

);

</aui:script >

Liferay in Action: The Official Guide to Liferay Portal Development

1 comment :

Unknown said...

Portal development service or web portal development service refers to the job of creating a portal that can help a company to build online community and makes users register more frequently for using its services. Website Portals