spring mvc - Use spaces into the tab titles with liferay tabs -
i'm working spring mvc portlets , liferay tabs. i'm having problem put spaces tab title. let's want define inside jsp:
<liferay-ui:tabs names="sample tab 1, sample tab 2" refresh="false" value="${mycontrollervalue}" > <liferay-ui:section> <jsp:include page='/jsp/mypage1.jsp' flush="true"/> </liferay-ui:section> <liferay-ui:section> <jsp:include page='/jsp/mypage2.jsp' flush="true"/> </liferay-ui:section> </liferay-ui:tabs>
this not working @ (eventhough, it's example documentation) , problem spaces names (it works fine if use names="tab1,tab2", that's not want show in tab titles)
besides, need control tab show controller. this:
if(whatever){ renderrequest.setattribute("mycontrollervalue", "sample tab 1"); }
and causes problem, because need show tab names in several languages, i'd need pass tab want in locale language match jsp id. best thing split title tab id , use tabvalues param, no idea how it...
i read redefine languages-ext.properties, import tab,
<%@taglib prefix="liferay-ui" uri="http://liferay.com/tld/ui" %>
so don't have properties file, , no clue how solve it.
i'd appreciate kind of issue.
thanks in advance!
edit:
trying apply answer posted below i'm having next error:
07:26:12,297 error [portletlocalserviceimpl:542] com.liferay.portal.kernel.xml.documentexception: error on line 20 of document : cvc-complex-type.2.4.a: invalid content found starting element 'resource-bundle'. 1 of '{"http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd":portlet-info, "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd":portlet-preferences, "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd":security-role-ref, "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd":supported-processing-event, "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd":supported-publishing-event, "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd":supported-public-render-parameter, "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd":container-runtime-option}' expected.
and portlet.xml file:
<portlet-app version="2.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"> <portlet> <portlet-name>myapp</portlet-name> <display-name>myapp</display-name> <portlet-class>org.springframework.web.portlet.dispatcherportlet</portlet-class> <init-param> <name>contextconfiglocation</name> <value>/web-inf/portlet/myapp-portlet.xml</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> </supports> <supported-locale>gl_es</supported-locale> <supported-locale>es_es</supported-locale> <resource-bundle>messages</resource-bundle> <resource-bundle>content/language</resource-bundle> <portlet-info> <title>myapp</title> <short-title>myapp</short-title> <keywords>myapp</keywords> </portlet-info> </portlet> </portlet-app>
you can use language.properties
have exact title names want in tab.
in <liferay-ui:tabs>
can have:
<liferay-ui:tabs names="sample-tab-1, sample-tab-2" refresh="false" value="${mycontrollervalue}" >
which nothing keys in language.properties
files as:
sample-tab-1=sample tab 1 sample-tab-2=sample tab 2
you can define language.properties
file in portlet.xml
as:
<portlet> ... ... <resource-bundle>content/language</resource-bundle> ... </portlet>
and file , other language files reside in source package inside content
folder, this:
docroot | |--> src | |--> content |--> language.properties |--> language_en.properties |--> language_ja.properties |--> language_de.properties ...
so in controller use:
if(whatever){ renderrequest.setattribute("mycontrollervalue", "sample-tab-1"); }
more liferay localization.
Comments
Post a Comment