Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Suresh Kumar
liferay-ui:message
30. März 2013 00:34
Antwort

Suresh Kumar

Rang: Junior Member

Nachrichten: 41

Eintrittsdatum: 9. Mai 2012

Neue Beiträge

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. April 2013 05:06
Antwort

Atin Agarwal

Rang: Junior Member

Nachrichten: 86

Eintrittsdatum: 19. Februar 2012

Neue Beiträge

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. April 2013 09:09
Antwort

Suresh Kumar

Rang: Junior Member

Nachrichten: 41

Eintrittsdatum: 9. Mai 2012

Neue Beiträge

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. April 2013 22:51
Antwort

Atin Agarwal

Rang: Junior Member

Nachrichten: 86

Eintrittsdatum: 19. Februar 2012

Neue Beiträge

Hi,

Yes, it should work.
Suresh Kumar
RE: liferay-ui:message
28. April 2013 00:36
Antwort

Suresh Kumar

Rang: Junior Member

Nachrichten: 41

Eintrittsdatum: 9. Mai 2012

Neue Beiträge

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