2
votes

I have trouble with portlet title. My portlet is created in struts framework. Portlet titles are set by Liferay UI manager (so the settings are stored in hsql script I guess, right?).

  1. I choose language option;
  2. After some action I expect to change portlet title depend on language version but it doesn't work; The changes are visible after reloading the page one more time;

I have tried to implement StrutsPortlet class and set title dynammically (renderResponse.setTitle) like this Liferay: Set title name for view pages It also doesn't work. The changes are visible after reloading page one more time. Why the changes are not visible immediately? I have read (http://colab.mpdl.mpg.de/mediawiki/images/3/38/PortletsinAction_Final.pdf) that "The setTitle method is defined only in the RenderResponse interface; you can only change the portlet title in the render request-processing phase". What it mean? Any suggest?

1
Please post your code. It is likely that you are setting the title before the language version is changed.Mark Chorley

1 Answers

0
votes

You should use resource bundle for localization of portlet title.

portlet.xml

    <portlet>
    <portlet-name>test-portlet</portlet-name>
    ...
            <resource-bundle>content.test-portlet</resource-bundle>
            ...
</portlet>

test-portlet.properties

javax.portlet.title=Test Portlet

test-portlet_sk.properties

javax.portlet.title=Testovaci Portlet