2013-02-13 66 views
3

我的門戶中有一個對話框,它打開了一個portlet。當我點擊鏈接並打開對話框時,對話框將顯示無法在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'] 
    ); 

感謝。

回答

4

我認爲你缺少的profile_WAR_profileportlet portlet的liferay-portlet.xml以下配置:

<add-default-resource>true</add-default-resource> 

這應設置爲true爲這是在對話框內訪問的門戶彈出窗口,這裏是這個元素的documentation

欲瞭解更多信息,你可以看看這個answer積分4 & 5的答案會對你有幫助。

+1

感謝您的幫助,我一直在尋找一天的修復程序......非常感謝 – saurjk 2013-02-13 10:06:43

0

難道是你設置了$ profile_url但實際上打開$ preferences_url上的對話框?我猜先前已經定義了preferences_url - 並且首選項(例如portlet編輯模式)通常需要比正常呈現階段更多的權限。通過訪問該管理員交叉檢查..

+0

哎呀,我發佈了兩個不同的代碼,我只是編輯它。實際上我有兩個變量$ profile_url和$ preferences_url,並且有兩個鏈接調用這兩個portlet。當我以我的開發環境中的管理員身份登錄時,會出現此問題。所以是的,我正在以管理員身份進行檢查。有什麼建議麼? – saurjk 2013-02-13 09:15:44

0

添加下面兩行的portal-ext.properties文件

portlet.add.default.resource.check.enabled=true 
portlet.add.default.resource.check.whitelist=3,56_INSTANCE_0000,58,82,86,103,113,145,164,166,170,33,---here append the portlet id which you want to display 
相關問題