How does Liferay Portal call the render phase of portlets?

thumbnail
Jonathan Cruz, modified 8 Years ago. New Member Posts: 19 Join Date: 3/18/16 Recent Posts
I´m traying to call a portlet render phase, not with another portlet but with a service, so do you know How does Liferay Portal call the render phase of portlets?, maybe I can use that logic in my service...
thumbnail
David H Nebinger, modified 8 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
This came up recently, I'm sure I answered it already.

But basically you can't and you shouldn't.

Render phase is invoked by the portal to generate the HTML fragment for aggregation into the whole rendered page. It actually renders the HTML fragment directly into the response object, it doesn't "return" anything in a function-call sense.

Certainly this is not something that you need to do in the service layer. The service layer is supposed to be render-technology-agnostic, it has no access to the request/response objects, and the context necessary to invoke render just won't be there.

Instead of sharing what you would like to do, how about asking us what you really need to do, likely there is some piece missing in your query that is key to providing you the right path to get this done.








Come meet me at the 2017 LSNA!