无法在Liferay对话框中打开Portlet

sau*_*rjk 3 portal portlet dialog liferay

我的门户网站中有一个对话框,该对话框打开一个Portlet。当我单击链接并打开对话框时,对话框显示

您没有访问此portlet所需的角色。

但是,如果我在页面上添加相同的portlet,则该portlet会在页面和对话框上打开而没有任何障碍。我在这里想念什么?有人知道吗?

我的代码是:

#set ($profile_url = $portletURLFactory.create($request, "profile_WAR_profileportlet", $getterUtil.getLong($plid), "RENDER_PHASE"))
 $profile_url.setParameter("p_p_state", "exclusive")

<a href="#" id="profile" onclick="openDialog('$profile_url','preferences-dialog',500,500)"> Profile </a> 



window,
        'openDialog', //function name
        function(url, popupID, wd, ht) { // parameters to the function
            var A = AUI();

            popupDialog = new A.Dialog({

                    id: popupID, // popupId passed so that it would be easy to close it through events other than the close button
                    centered: false, // all the different parameters function you can check in the Alloy API
                    draggable: true,
                    resizable: false,
                    width: wd,
                    stack: true,
                    modal: true,
                    height: ht,
                    scrollbars: true,
                    xy: [getWidth()/2-wd/2,10]
                }
            ).plug(
                A.Plugin.IO,
                {
                    uri: url
                }
            );

            popupDialog.render();
        },
        ['aui-dialog','aui-dialog-iframe']
    );
Run Code Online (Sandbox Code Playgroud)

在此先感谢任何人都可以提供的帮助。

Pra*_*h K 5

我认为您liferay-portlet.xmlprofile_WAR_profileportletPortlet 中缺少以下配置:

<add-default-resource>true</add-default-resource>
Run Code Online (Sandbox Code Playgroud)

应该将其设置true为在对话框弹出窗口中访问的portlet,这是此元素的文档

有关更多信息,您可以查看此答案,答案的第4点和第5点将对您有所帮助。