【问题标题】:Portlet in a modal dialog box模式对话框中的 Portlet
【发布时间】:2014-07-28 06:53:25
【问题描述】:

我正在使用 liferay 6.2 服务器来开发 Web 应用程序。 一些功能需要在模态框中呈现。 是否可以使 portlet 的行为类似于模式对话框,或者是否有任何方法可以将 portlet 放入模式对话框中? 我花了很多时间搜索一些文档,但找不到任何文档。 非常感谢任何输入或参考!

我想拥有类似 JIRA 的功能... - 当您单击“创建问题”按钮时,它会在 portlet 中弹出,不是吗?

想知道我怎么会有同样的行为?

【问题讨论】:

标签: java liferay liferay-6


【解决方案1】:

这在 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>

【讨论】:

    猜你喜欢
    • 2014-05-28
    • 1970-01-01
    • 2015-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-01
    • 1970-01-01
    相关资源
    最近更新 更多