简体   繁体   English

Liferay-Portlet标题重装

[英]Liferay - portlet title reloading

I have trouble with portlet title. 我在Portlet标题方面遇到麻烦。 My portlet is created in struts framework. 我的portlet是在struts框架中创建的。 Portlet titles are set by Liferay UI manager (so the settings are stored in hsql script I guess, right?). Portlet标题是由Liferay UI管理器设置的(因此,这些设置存储在hsql脚本中,我想是吧?)。

  1. I choose language option; 我选择语言选项;
  2. After some action I expect to change portlet title depend on language version but it doesn't work; 经过一些操作,我希望根据语言版本来更改portlet标题,但是它不起作用; 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. 我试图实现StrutsPortlet类,并像这样设置Liferay动态设置标题 (renderResponse.setTitle) :为视图页面设置标题名称,这也行不通。 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 ". 我已经阅读了( http://colab.mpdl.mpg.de/mediawiki/images/3/38/PortletsinAction_Final.pdf ),“ setTitle方法仅在RenderResponse接口中定义;您只能在呈现请求处理阶段 ”。 What it mean? 什么意思? Any suggest? 有什么建议吗?

You should use resource bundle for localization of portlet title. 您应该使用资源包对portlet标题进行本地化。

portlet.xml portlet.xml

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

test-portlet.properties test-portlet.properties

javax.portlet.title=Test Portlet

test-portlet_sk.properties test-portlet_sk.properties

javax.portlet.title=Testovaci Portlet

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM