在其他Liferay Portlet内显示Liferay Portlet [英] Display Liferay portlet inside other liferay portlet

查看:137
本文介绍了在其他Liferay Portlet内显示Liferay Portlet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Liferay Portlet软件包6.2(Tomcat)和Liferay IDE(eclipse).我创建了两个Liferay插件项目.在第一个portlet(第一个插件portlet)中,我使用Portlet首选项保存了一些数据.现在,我将在第一个portlet中显示第二个portlet.我该怎么做?我找到了以下代码和此链接

I use Liferay portlet bundle 6.2 (Tomcat) and Liferay IDE(eclipse). I created two Liferay Plugin Project. In the first portlet(first plugin portlet), I save some data by using Portlet Preferences. Now, I will display second portlet in first portlet. How I can do that? I found this following code and this Link

从其他portlet打开portlet

    var url;
function createRenderURL(portletId) {       
AUI().ready('liferay-portlet-url', function(A) {
    var renderURL = Liferay.PortletURL.createRenderURL();
    renderURL.setName("test");       
    renderURL.setWindowState("pop_up"); 
    renderURL.setPortletId(portletId);           
    url = renderURL.toString();
});}

但是,我不理解这段代码吗?我添加此代码以查看jsp,在哪里可以找到portletId?拜托,有人可以向我解释一下吗?我是Liferay的新人

But, I don't unterstand this code? I add this code to view jsp, where I can found portletId? Please, can someone explain me this a little bit? I'm new in Liferay

推荐答案

这取决于您的portlet是否可实例化.

It depends if your portlet is instanciable or not.

难以理解:您的portletId应该看起来像 Weather_WAR_WeatherPortlet

Not instanciable: your portletId should looks like Weather_WAR_WeatherPortlet

令人难以置信:您的portletId应该类似于 Weather_WAR_WeatherPortlet_INSTANCE_5aSc

Instanciable: your portletId should looks like Weather_WAR_WeatherPortlet_INSTANCE_5aSc

您可以在数据库内的表"portlet"上检查portletId.

You can check portletId on the table "portlet" inside your database.

如果要通过编程获取它,则应使用PortletConfig类

If you want to get it by programmation you should use PortletConfig class

((com.liferay.portlet.PortletConfigImpl) portletConfig).getPortletId() 

NB:编号为portletId的是Liferay Portlet

NB: portletId which are number are Liferay portlet

这篇关于在其他Liferay Portlet内显示Liferay Portlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆