I found a blog from Liferay and test it through my portal (Liferay 6.2 CE GA4). It works:
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui" %>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<portlet:defineObjects />
<portlet:renderURL var="PopupURL" windowState="<%=LiferayWindowState.POP_UP.toString()%>">
<portlet:param name="jspPage" value="/edit.jsp"/>
</portlet:renderURL>
<aui:button name="test-popup" id="test-popup" value="popup"> </aui:button>
<aui:script>
AUI().use('aui-base','liferay-util-window','aui-io-plugin-deprecated',function(A){
A.one('#<portlet:namespace/>test-popup').on('click', function(event){
var test_popup= Liferay.Util.Window.getWindow(
{
dialog: {
centered: true,
constrain2view: true,
modal: true,
resizable: false,
width: 800
}
}).plug(A.Plugin.DialogIframe,
{
autoLoad: true,
iframeCssClass: 'dialog-iframe',
uri:'<%=PopupURL.toString()%>'
}).render();
test_popup.show();
test_popup.titleNode.html("Login");
});
});
</aui:script>
If you have multi-porlets in your project, simply change the value of parameter "jspPage" from "/edit.jsp" to "/html/[portlet_name]/edit.jsp" or a known url path.
edit.jsp
in<init-param>
and add<portlet-mode>edit</portlet-mode>
to<supports>
inportlet.xml
. Then in your action overridedoEdit
method andinclude(editJSP, renderRequest, renderResponse);
at the bottom of it. – Parkash Kumar