I'm attempting to communicate two views, the first view within portlet-A, and the second view within portlet-B (both portlets within same .war). To do so, I've decided to use the JSF 'f:viewParam' and 'f:param' features in order to inject a property (from portlet-A view) into the request object, so that the portlet-B view can retrieve it from the request object and pass such property value to a view scoped backing bean property.
Portlet-A view code:
<p:dataScroller value="#{searchManager.List}" var="ccp" >
...
<p:link value="#{ccp.title}" onclick="myonClick(event)" >
<f:param name="id" value="#{ccp.id}" />
</p:link>
...
</p:dataScroller>
JS code:
function myonClick(event) {
event.preventDefault();
window.open("viewer", "_blank");
}
Note that portlet-B view have to be displayed on a Liferay-based page, different to the one where the portlet-A view is displayed.
Portlet-B view code:
<f:metadata>
<f:viewParam name="id" value="#{resultItemManager.id}" />
</f:metadata>
<h:head />
<h:body>
<p>Details:</p>
<h:outputText value="#{resultItemManager.id}" />
</h:body>
When portlet-B gets displayed, the browser address field is set to 'http://host:8080/viewer' and the tag gets rendered as '0' (zero).
I don't know if the way i'm doing the targeted task is the right one or not. But if it is, i don't know why it isn't working. So I'd really appreciate any help/comments. Thanks in advance.