Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Suresh Kumar
liferay-ui:message
30 marzo 2013 0.34
Risposta

Suresh Kumar

Punteggio: Junior Member

Messaggi: 33

Data di Iscrizione: 9 maggio 2012

Messaggi recenti

Hi,

We are using <display:table> for display of data and we need to add (say for example)<liferay-ui:message key="gender"/> for the title attribute of the <display:column>.

Could anyone please help me on this.

The following are not working
1. <display:column property="gender" title='<liferay-ui:message key="gender"/>' sortable="true" headerClass="sortable" />
2. <display:column property="gender" title="<liferay-ui:message key="gender"/>" sortable="true" headerClass="sortable" />

Thanks,
Suresh
Atin Agarwal
RE: liferay-ui:message
1 aprile 2013 5.06
Risposta

Atin Agarwal

Punteggio: Junior Member

Messaggi: 74

Data di Iscrizione: 19 febbraio 2012

Messaggi recenti

Hi Suresh,

Instead of
<display:column property="gender" title='<liferay-ui:message key="gender"/>' sortable="true" headerClass="sortable" />


use simply--
<display:column property="gender" title='gender' sortable="true" headerClass="sortable" />

OR
if you want to get it from language file you can use

<display:column property="gender" title='<%= LanguageUtil.get(locale, 'gender')%>' sortable="true" headerClass="sortable" />

Hope it would be helpful

Regards,

Atin Agarwal
Suresh Kumar
RE: liferay-ui:message
2 aprile 2013 9.09
Risposta

Suresh Kumar

Punteggio: Junior Member

Messaggi: 33

Data di Iscrizione: 9 maggio 2012

Messaggi recenti

Atin Agarwal:
Hi Suresh,

Instead of
<display:column property="gender" title='<liferay-ui:message key="gender"/>' sortable="true" headerClass="sortable" />


use simply--
<display:column property="gender" title='gender' sortable="true" headerClass="sortable" />

OR
if you want to get it from language file you can use

<display:column property="gender" title='<%= LanguageUtil.get(locale, 'gender')%>' sortable="true" headerClass="sortable" />

Hope it would be helpful

Regards,

Atin Agarwal


Hi Atin,

Thanks for the reply. My requirement is to read from the Language.properties file as it has to change as per the language selected.

Please let me know if your second option (title='<%= LanguageUtil.get(locale, 'gender')%>') works.

Thanks,
Suresh
Atin Agarwal
RE: liferay-ui:message
7 aprile 2013 22.51
Risposta

Atin Agarwal

Punteggio: Junior Member

Messaggi: 74

Data di Iscrizione: 19 febbraio 2012

Messaggi recenti

Hi,

Yes, it should work.
Suresh Kumar
RE: liferay-ui:message
28 aprile 2013 0.36
Risposta

Suresh Kumar

Punteggio: Junior Member

Messaggi: 33

Data di Iscrizione: 9 maggio 2012

Messaggi recenti

Hi,

I Got the solution and here it is...

1. <display:column property="gender" titleKey="gender" sortable="true" headerClass="sortable" />
The problem is it sometimes works and otherwise no. So, I used the following solution in my application...

2. <c:set var="disTtitle"><liferay-ui:message key="gender" /></c:set>
<display:column property="gender" title="${disTtitle}" sortable="true" headerClass="sortable" />

Second solution works perfectly and please follow the second in all your business needs.

Thanks,
Suresh