Affects Version/s: portal-3.0.0
Fix Version/s: None
Component/s: Liferay Faces Portal / Demos / Tests
This is a followup to -
-. I ran into similar problems in AJAX requests. FACES-1212
The problem is here (I stripped the code comments):
In my case the liferayManagedBean is null. I guess because I'm using JEE with CDI - but I didn't look into that further.
What I'm wondering: Even if it is not null, what happens if the liferayManagedBean wasn't initialized in a render request before? As it uses the same WebKeys.RENDER_PORTLET attribute, it won't have access to the portlet either. And why don't you use the portlet attached to the portlet request?
I'm using now this code:
The same I did for an extension of the liferay bean that I put into the JEE scope.
This returns always a portlet for me, even in a resource request. And I think the cast to
LiferayPortletRequest is using the same internal knowledge as the access to WebKeys.RENDER_PORTLET - I mean both access methods are equally "dangerous" when looking at interoperability.