[英]liferay portlet preferences show in popup
I have portlet which is embedded like this inside web content: 我有这样嵌入在Web内容中的Portlet:
runtime-portlet name="somePortletName" instance="54363734" queryString=""
It has custom jsp edit page which I would like to open in a popup window, because there is not enough space in place where this small portlet is embedded. 它具有自定义的jsp编辑页面,我想在弹出窗口中打开该页面,因为没有足够的空间嵌入这个小portlet。 How can I achieve this?
我该如何实现?
I found a blog from Liferay and test it through my portal (Liferay 6.2 CE GA4). 我从Liferay找到了一个博客 ,并通过我的门户网站对其进行了测试(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. 如果您的项目中有多个项目,只需将参数“ jspPage”的值从“ /edit.jsp”更改为“ /html/[portlet_name]/edit.jsp”或已知的URL路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.