问题
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
Open portlet from other 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();
});}
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
回答1:
It depends if your portlet is instanciable or not.
Not instanciable: your portletId should looks like Weather_WAR_WeatherPortlet
Instanciable: your portletId should looks like Weather_WAR_WeatherPortlet_INSTANCE_5aSc
You can check portletId on the table "portlet" inside your database.
If you want to get it by programmation you should use PortletConfig class
((com.liferay.portlet.PortletConfigImpl) portletConfig).getPortletId()
NB: portletId which are number are Liferay portlet
来源:https://stackoverflow.com/questions/33276042/display-liferay-portlet-inside-other-liferay-portlet