Forums de discussion

JavaScript to access portlets on screen

Gwowen Fu, modifié il y a 11 années.

JavaScript to access portlets on screen

Expert Publications: 315 Date d'inscription: 27/12/10 Publications récentes
Hi,

How could I access portlets on screen using Liferay Javascript API?

I was able to add a portlet to page using the following script but not able to access it through Liferay object.

function openAssetPublisher(currentElement, articleId) {

var plid = themeDisplay.getPlid();
var portletId = '101';
var onComplete = function(){ alert("hi"); location.reload(true); };
var beforePortletLoaded = null;
var portletOptions = {
beforePortletLoaded: beforePortletLoaded,
onComplete: onComplete,
plid: plid,
portletId: portletId,
};

Liferay.Portlet.add(portletOptions);
}

Thanks!
Gwowen
Gwowen Fu, modifié il y a 11 années.

RE: JavaScript to access portlets on screen (Réponse)

Expert Publications: 315 Date d'inscription: 27/12/10 Publications récentes
Fount it. It is Liferay.Layout.getPortlets().