Tuesday, November 2, 2010

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>

- Gnaniyar Zubair

1 comments:

brahim said...

hello,

how can call this method in jsp page?

Post a Comment

Share & Enjoy

Twitter Delicious Facebook Digg Stumbleupon Favorites More