Foros de discusión

What are the available objects in xhtml files?

Fernando Cabrera, modificado hace 9 años.

What are the available objects in xhtml files?

Junior Member Mensajes: 47 Fecha de incorporación: 1/08/14 Mensajes recientes
Hello

Are there some default available objects in xhtml file as in velocity? (Access Objects from Velocity)

I saw this file that has the line:

<c:when test="#{liferay.themeDisplay.signedIn}"></c:when>

But I don't know what is missing in my project to make use of that.

What I need is themeDisplay in order to make reference to a theme image from a jsf portlet. The way I'm doing it is this:

Manage bean:
private String pathThemeImages;// + getter and setter
//...
ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
pathThemeImages = themeDisplay.getPathThemeImages();


xhtml:
<img src="#{myManageBean.pathThemeImages}/icons/help.png">

Rather not have to add the logic to the manage bean if there is a way to do it directly in the xhtml code

Thanks!
thumbnail
David H Nebinger, modificado hace 9 años.

RE: What are the available objects in xhtml files?

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
I like the custom resolver approach. I've done these for accessing spring beans within xhtml before, but certainly you could do the same to expose ThemeDisplay.
thumbnail
Kyle Joseph Stiemann, modificado hace 9 años.

RE: What are the available objects in xhtml files? (Respuesta)

Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientes
Hi Fernando,
You should be able to access these EL objects in xhtml files (for example: #{liferay.themeDisplay}). If that doesn't work, make sure that Liferay Faces Portal jar in your project and check to make sure that your are using the correct version of the Liferay Faces jars.

- Kyle
Fernando Cabrera, modificado hace 9 años.

RE: What are the available objects in xhtml files?

Junior Member Mensajes: 47 Fecha de incorporación: 1/08/14 Mensajes recientes
Thank you Kyle, those links are a good reference and works for me without additional changes in my project, I suppose that was a typo error the first time I tried