I've been working on a programmatic creation of Liferay actionUrls in the MVCPortlet
Controller.
So far, I have successfully managed to create a working link to the action of another portlet,
placed in another page (Layout
in Liferay terms) by using this code:
LiferayPortletResponse rr = PortalUtil.getLiferayPortletResponse( response);
Layout layout = ... // I manage to get the correct one using LayoutLocalServiceUtil
LiferayPortletURL ddUrl = rr.createActionURL("portlet_WAR_name") ;
if(Validator.isNotNull(layout)){
// Setting info to the other portlet
ddUrl.setPlid(layout.getPlid());
// Setting the action Name
ddUrl.setParameter(ActionRequest.ACTION_NAME, "actionFunctionNameOf_MVCPortlet");
// adding any action-related params
ddUrl.setParameter("someParam1", ...) );
ddUrl.setParameter("someParam2", ...) );
return ddUrl;
}
My problem is that this will not work on an instanceable Portlet.
Is there some parameter I could add, to make this url link to -any-
instance of the target Portlet?
Or do I need to know the instanceId
of the target Portlet? If so, how can I set this to the LiferayPortletURL
instance?
Thanx in advance, any help would be really appreciated
P.S.: I'm working with Liferay 6.1 GA1