Thursday, December 27, 2012

Popup in liferay using AUI

Below code is used to show a popup using AUI:


<portlet:renderURL var="somePageURL" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
  <portlet:param name="jspPage" value="/jsp/some/page.jsp"/>
  <portlet:param name="redirect" value="<%= currentURL %>"/>
</portlet:renderURL>
 <script type="text/javascript">
function showPopup() {
  AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
    
    var dialog = new A.Dialog({
            title: 'Popup Title',
            centered: true,
            draggable: true,
            modal: true
        }).plug(A.Plugin.IO, {uri: '<%= somePageURL %>'}).render();
        
        dialog.show();
        
  });
}
Cheers, Ujjwal Soni

No comments: