Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Ralph Koster
LiferayFacesContext in LiferayFacesBridge for Liferay 7
November 18, 2016 6:36 AM
Answer

Ralph Koster

Rank: New Member

Posts: 17

Join Date: November 8, 2013

Recent Posts

Hi everyone,

i've got a question about Liferay 7 and LiferayFacesBridge. In earlier versions of Liferay and FacesBridge I had the possibility to get current user, themeDisplay etc. through LiferayFacesContext.

E.g
1LiferayFacesContext.getInstance().getThemeDisplay();
2LiferayFacesContext.getInstance().getUser();


Right now, I'm updating my JSF project for Liferay 7 and I saw that LiferayFacesContext class doesn't exist anymore.
So how can I get those objects with new version of LiferayFacesBridge?

Thanks in advance
Ralph
Vernon Singleton
RE: LiferayFacesContext in LiferayFacesBridge for Liferay 7
November 18, 2016 2:56 PM
Answer

Vernon Singleton

LIFERAY STAFF

Rank: Expert

Posts: 297

Join Date: January 14, 2013

Recent Posts

Hi Ralph,

Ralph Koster:
i've got a question about Liferay 7 and LiferayFacesBridge. In earlier versions of Liferay and FacesBridge

Make sure you are using the dependencies given when you use the archetype portlet here.

Ralph Koster:
I had the possibility to get current user, themeDisplay etc. through LiferayFacesContext.

E.g
1LiferayFacesContext.getInstance().getThemeDisplay();
2LiferayFacesContext.getInstance().getUser();


Right now, I'm updating my JSF project for Liferay 7 and I saw that LiferayFacesContext class doesn't exist anymore.

That is very perceptive, and this is a great question that I am excited to answer. I think many other folks will have a similar question.

Ralph Koster:
So how can I get those objects with new version of LiferayFacesBridge?

You should be able to use the liferay-faces-portal jar, and its new LiferayPortletHelperUtil object ...
for the ThemeDisplay
and the User.

Hope that helps,
Vernon
Ralph Koster
RE: LiferayFacesContext in LiferayFacesBridge for Liferay 7
November 21, 2016 3:58 AM
Answer

Ralph Koster

Rank: New Member

Posts: 17

Join Date: November 8, 2013

Recent Posts

Hi Vernon,

thanks for your answer, that helped me a lot.

Cheers
Ralph