Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Suresh Kumar
liferay-ui:message
March 30, 2013 12:34 AM
Answer

Suresh Kumar

Rank: Junior Member

Posts: 40

Join Date: May 9, 2012

Recent Posts

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
April 1, 2013 5:06 AM
Answer

Atin Agarwal

Rank: Junior Member

Posts: 84

Join Date: February 19, 2012

Recent Posts

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
April 2, 2013 9:09 AM
Answer

Suresh Kumar

Rank: Junior Member

Posts: 40

Join Date: May 9, 2012

Recent Posts

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
April 7, 2013 10:51 PM
Answer

Atin Agarwal

Rank: Junior Member

Posts: 84

Join Date: February 19, 2012

Recent Posts

Hi,

Yes, it should work.
Suresh Kumar
RE: liferay-ui:message
April 28, 2013 12:36 AM
Answer

Suresh Kumar

Rank: Junior Member

Posts: 40

Join Date: May 9, 2012

Recent Posts

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