掲示板

liferay-ui:message

11年前 に Suresh Kumar によって更新されました。

liferay-ui:message

Junior Member 投稿: 47 参加年月日: 12/05/09 最新の投稿
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
thumbnail
11年前 に Atin Agarwal によって更新されました。

RE: liferay-ui:message

Junior Member 投稿: 86 参加年月日: 12/02/20 最新の投稿
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
11年前 に Suresh Kumar によって更新されました。

RE: liferay-ui:message

Junior Member 投稿: 47 参加年月日: 12/05/09 最新の投稿
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
thumbnail
11年前 に Atin Agarwal によって更新されました。

RE: liferay-ui:message

Junior Member 投稿: 86 参加年月日: 12/02/20 最新の投稿
Hi,

Yes, it should work.
10年前 に Suresh Kumar によって更新されました。

RE: liferay-ui:message

Junior Member 投稿: 47 参加年月日: 12/05/09 最新の投稿
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