set Portlet Title Dynamically

How do I set Portlet title dynamically? I know you can set title using RenderResponse (response.setTitle(“CPM-RENDER_REQUEST”):wink: , But this is called only once per session. I want to set the title when my view changes in the applications. Is this possible in vaadin Portlet?

Directly, no. Indirectly, yes…

In V6 you can register a PortletListener which will get invoked for every incoming request. In the handleRenderRequest() method you’ll have to create, you get the RenderRequest, which you can then change the title in.

In V7 you can get to the current PortletRequest using VaadinPortletService.getCurrentPortletRequest() and set the title there.

I’m currently using Vaadin 6. I’m implementing PortletListener, PortletRequestListener and handleRenderRequest() method gets called only once. When I click on a button I change my vaadin app view and I should be able to change the portlet title.

Well, that’s the rub. Vaadin is an ajax-based system and therefore you only get one render request…

I think Liferay has some javascript to change the portlet title (never used it myself), so you could use your application class to exec javascript to change the portlet title that way…