Foren

how to use portal:runtime

Eric Soucy, geändert vor 8 Jahren.

how to use portal:runtime

Junior Member Beiträge: 65 Beitrittsdatum: 21.01.14 Neueste Beiträge
hello,
I was trying to use the portal:runtime in the 4.2 beta.
I'm trying to show one of my portlets


	
		<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:portal="http://liferay.com/faces/portal" xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
			<portal:runtime portletName="poc_master" />
		</ui:composition>
	


But It does not show up and I see an error telling me that the portlet must be redeployed.

Can you help me?

Thanks so much
thumbnail
Juan Gonzalez, geändert vor 8 Jahren.

RE: how to use portal:runtime

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Eric,

this isn't a Liferay Faces issue but I will try to help you.

Search for your deployed portlet in "Portlet" table in DB, and copy/paste the contents of "portletId" to "portletName" attribute. You have to find which portlet you really want to render.

Hope it helps.
thumbnail
Juan Gonzalez, geändert vor 8 Jahren.

RE: how to use portal:runtime

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Eric, BTW, your xhtml doesn't seem fine, remember your should use <h:body>, <h:head>, and <f:view> for using the best practices and avoiding weird errors.
thumbnail
Neil Griffin, geändert vor 8 Jahren.

RE: how to use portal:runtime

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
Another way you can find out the portletId is to add it manually to a page, then look at the HTML source. For example, the Liferay Faces Showcase portlet causes the following HTML to be rendered:
Eric Soucy, geändert vor 8 Jahren.

RE: how to use portal:runtime

Junior Member Beiträge: 65 Beitrittsdatum: 21.01.14 Neueste Beiträge
Hello,
I first thought the portlet name had to be the one declared in the portlet.xml file.
I tried what you said but i end up with the 1st screenshot i have included.

In the second screen shot you can see the actual portlet

here is the code for the container portlet:



	
		<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:portal="http://liferay.com/faces/portal" xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
			<portal:runtime portletName="portlet_poc_master_WAR_poc_master" />
		</ui:composition>
	
	

What have I done wrong ?

Thanks
Eric Soucy, geändert vor 8 Jahren.

RE: how to use portal:runtime

Junior Member Beiträge: 65 Beitrittsdatum: 21.01.14 Neueste Beiträge
OK I think I got it to work
here is my code , I had to trim the "portlet_" at the start of the name. It's strange because the id had this in the section on my other page where this same portlet is visible..



	
		<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:portal="http://liferay.com/faces/portal" xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
			<portal:runtime portletName="poc_master_WAR_poc_master" />
		</ui:composition>
	
	

thumbnail
Neil Griffin, geändert vor 8 Jahren.

RE: how to use portal:runtime

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
Congratulations Eric! I'm glad to hear that it is working in your environment. emoticon
thumbnail
Juan Gonzalez, geändert vor 8 Jahren.

RE: how to use portal:runtime

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Eric,

then probably it's much better you to use the portletId from "Portlet" table in DB., as this html id's may change in future depending on needs/namespacing conventions, but portletId from DB isn't likely to change, as it's being used a lot within Liferay internals.