我正在使用 liferay 6.2 服务器来开发 Web 应用程序。 一些功能需要在模态框中呈现。 是否可以使 portlet 表现得像模态对话框,或者是否有任何方法可以将 portlet 放入模态对话框中? 我花了很多时间搜索一些文档,但找不到任何文档。 非常感谢任何意见或引用!
我想要一个类似 JIRA 的功能... - 当您单击“创建问题”按钮时,它会在 portlet 中弹出,不是吗?
想知道我怎样才能有同样的行为?
最佳答案
这在 Liferay 6.1 中工作得很好,我还没有在 6.2 中测试过。
在您的 JSP 中:
<liferay-portlet:renderURL
var="myPopUpURL"
portletName="myPortletName_WAR_myPortletNameportlet"
windowState="<%=LiferayWindowState.POP_UP.toString() %>"
<liferay-portlet:param name="myParamName1" value="myParamValue1" />
<liferay-portlet:param name="myParamName2" value="myParamValue2" />
</liferay-portlet:renderURL>
<% myPopUpURL="javascript:showPopup('"+myPopUpURL+"')"; %>
<aui:button value="Show PopUp" onClick="<%=myPopUpURL %>"/>
<aui:script>
function showPopup(url) {
var url = url;
Liferay.Util.openWindow(
{
dialog: {
width:800,
centered: true,
resizable: false,
title: 'MyTitle',
modal: true
/* there are many other options... */
},
id: 'myPopUpId',
uri: url
}
);
}
</aui:script>
关于java - 模式对话框中的 Portlet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24091372/