Message Boards

Embed JSF portlet on a vm template

jose fernandez, modified 4 Years ago.

Embed JSF portlet on a vm template

New Member Posts: 13 Join Date: 3/2/20 Recent Posts
Hello there,We are trying to embed a JSF portlet into a WC VM template but it fails. 
$theme.runtime("download_WAR_VPPportlet", $portletProviderAction.VIEW)
or
$theme.runtime("download_WAR_VPPportlet", $portletProviderAction.VIEW, "", $!default_preferences)

we get the following message:
"An app that can VIEW download_WAR_VPPportlet belongs here. Please contact the portal administrator or install such an app from the Liferay Marketplace."

when you chek the list of availabe portlet , the portlet is in the list but it is disabled as it is not instanciable.How this can be done?José
thumbnail
Neil Griffin, modified 4 Years ago.

RE: Embed JSF portlet on a vm template

Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
Hi José,
Is your portlet instanceable? See the following portlet.xml as an example:
https://github.com/liferay/liferay-faces-bridge-impl/blob/master/demo/jsf-applicant-portlet/src/main/webapp/WEB-INF/liferay-portlet.xml#L7

If it is instanceable, the portlet key would need to look something more like "download_WAR_VPPportlet_INSTANCE_a000"
Also, you need to make sure that you have the "download_WAR_VPPportlet" portlet ID correct. I just inspected the HTML source of a Liferay Portal 7.2 page for the aforementioned jsf-applicant-portlet and was able to find the portlet ID in the surrounding markup like the following:
<div class="portlet-boundary portlet-boundary_1_WAR_comliferayfacesdemojsfapplicantportlet_ portlet-borderless portlet-draggable yui3-dd-drop" id="p_p_id_1_WAR_comliferayfacesdemojsfapplicantportlet_INSTANCE_yDWcvpNnSjzj_">
&nbsp; &nbsp; <span id="p_1_war_comliferayfacesdemojsfapplicantportlet_instance_ydwcvpnnsjzj">
&nbsp; &nbsp; &nbsp; &nbsp; </span id="p_1_war_comliferayfacesdemojsfapplicantportlet_instance_ydwcvpnnsjzj"></div>
jose fernandez, modified 4 Years ago.

RE: Embed JSF portlet on a vm template

New Member Posts: 13 Join Date: 3/2/20 Recent Posts
Hi Neil,
The portlet is not instantiable. The problem has been solved migrating the templates to FreeMarker; with ftl no problem all works as expected.
Cheers,
José
thumbnail
Neil Griffin, modified 4 Years ago.

RE: Embed JSF portlet on a vm template

Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
José -- Thanks for posting the solution to the problem, and thanks for using Liferay Faces. emoticon
ghadeer raad, modified 3 Years ago.

RE: Embed JSF portlet on a vm template

Junior Member Posts: 51 Join Date: 6/2/20 Recent Posts
hi i use liferay portal 7.2 so,can i use jsp to make auto refresh(reload to the main page )?