Fórumok

how to use portal:runtime

Eric Soucy, módosítva 8 év-val korábban

how to use portal:runtime

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2014.01.21. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: how to use portal:runtime

Liferay Legend Bejegyzések: 3089 Csatlakozás dátuma: 2008.10.28. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: how to use portal:runtime

Liferay Legend Bejegyzések: 3089 Csatlakozás dátuma: 2008.10.28. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: how to use portal:runtime

Liferay Legend Bejegyzések: 2655 Csatlakozás dátuma: 2005.07.27. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: how to use portal:runtime

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2014.01.21. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: how to use portal:runtime

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2014.01.21. Legújabb bejegyzések
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, módosítva 8 év-val korábban

RE: how to use portal:runtime

Liferay Legend Bejegyzések: 2655 Csatlakozás dátuma: 2005.07.27. Legújabb bejegyzések
Congratulations Eric! I'm glad to hear that it is working in your environment. emoticon
thumbnail
Juan Gonzalez, módosítva 8 év-val korábban

RE: how to use portal:runtime

Liferay Legend Bejegyzések: 3089 Csatlakozás dátuma: 2008.10.28. Legújabb bejegyzések
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.