Display portlet as popup in theme
Step 1: Open the portal-normal.vm file and write the below code.
<a href="#" onClick = "showPopup()">Show Popup </a>
where 'login_WAR_portlet' is the portlet name.
Step 2: Write the javascript code for popup in portal-normal.vm or any other .js file.
Step 3: Open liferay-portlet.xml add the following line.
<add-default-resource>true</add-default-resource>
portal-normal.vm
#set ($popupUrl = $portletURLFactory.create($request,"login_WAR_portlet",$page.getPlid(), "RENDER_PHASE"))
$popupUrl .setParameter("p_p_state", "exclusive")
$popupUrl .setPortletMode("view")
<a href="#" onClick = "showPopup()">Show Popup </a>
where 'login_WAR_portlet' is the portlet name.
Step 2: Write the javascript code for popup in portal-normal.vm or any other .js file.
<aui:script>
AUI().use('aui-base',
'aui-io-plugin-deprecated',
'liferay-util-window',
function(A) {
function showPopup(){
var
popUpWindow=Liferay.Util.Window.getWindow(
{
dialog: {
centered: true,
constrain2view:
true,
//cssClass:
'yourCSSclassName',
modal: true,
resizable: false,
width: 475
}
}
).plug(
A.Plugin.IO,
{
autoLoad: false
}).render();
popUpWindow.show();
popUpWindow.titleNode.html("Liferay
6.2 Dialog Window");
popUpWindow.io.set('uri','$popupUrl');
popUpWindow.io.start();
}
});
</aui:script>Step 3: Open liferay-portlet.xml add the following line.
<add-default-resource>true</add-default-resource>
Impressed alot.I really like your blog.Thanks for the post. Pop up System Services in Malaysia
ReplyDeleteThanks for sharing your post. Popup System in malaysia
ReplyDeleteThe blog was absolutely fantastic! Lot of information is helpful in some or the other way. Keep updating the blog, looking forward for more content...Great job, keep it up.
ReplyDeletePop Up System services in Malaysia
Really nice info you posted thanks for sharing this with us. We provide Pop Up strategies.
ReplyDelete