掲示板

Dynamic Data List Template: Get field label

thumbnail
10年前 に Afif Abu Bakar によって更新されました。

Dynamic Data List Template: Get field label

Junior Member 投稿: 25 参加年月日: 12/08/06 最新の投稿
Hi guys,

I'm following this blog post to create a custom template for dynamic data list https://www.liferay.com/web/marcellus.tavares/blog/-/blogs/dynamic-data-lists-iii
It's only shows how to get the value from the form but not the value for the property. I would like to get the Field Label value.
Anyone knows how can I get that value?

Thank you.


10年前 に Bradley Wood によって更新されました。

RE: Dynamic Data List Template: Get field label

thumbnail
10年前 に Afif Abu Bakar によって更新されました。

RE: Dynamic Data List Template: Get field label

Junior Member 投稿: 25 参加年月日: 12/08/06 最新の投稿
Bradley Wood:
If I was to guess

#set ($labelField = $fields.get("label")) or "fieldLabel"


Nope. Not working. I want to get the Assigned To value from the Field Label property. Any other guess? emoticon
10年前 に Arun Kulasegaran によって更新されました。

RE: Dynamic Data List Template: Get field label

New Member 投稿: 8 参加年月日: 13/08/23 最新の投稿
Hi,
I'm new to liferay. Can u help me in validating dynamic data list fields before submitting it. Its Urgent
thumbnail
10年前 に Afif Abu Bakar によって更新されました。

RE: Dynamic Data List Template: Get field label

Junior Member 投稿: 25 参加年月日: 12/08/06 最新の投稿
Anyone can help me with this? I just want to get the value for label.
9年前 に Tomas Augustaitis によって更新されました。

RE: Dynamic Data List Template: Get field label

New Member 投稿: 6 参加年月日: 13/10/15 最新の投稿
In FreeMarker template it goes like this:


<#assign DDMStructureLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService")>
 <#assign meta = DDMStructureLocalService.getStructure(reserved_ddm_structure_id)>
...

${meta.getFieldLabel("Column1", locale)}

9年前 に Pierre-François Fiat によって更新されました。

RE: Dynamic Data List Template: Get field label

New Member 投稿: 11 参加年月日: 14/07/25 最新の投稿
Tomas Augustaitis:
In FreeMarker template it goes like this:


<#assign DDMStructureLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService")>
 <#assign meta = DDMStructureLocalService.getStructure(reserved_ddm_structure_id)>
...

${meta.getFieldLabel("Column1", locale)}




I get the following error in my adt:

No signature of method getStructure matches the arguments
thumbnail
9年前 に James Falkner によって更新されました。

RE: Dynamic Data List Template: Get field label

Liferay Legend 投稿: 1399 参加年月日: 10/09/17 最新の投稿
Pierre-François Fiat:
Tomas Augustaitis:
In FreeMarker template it goes like this:


<#assign DDMStructureLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService")>
 <#assign meta = DDMStructureLocalService.getStructure(reserved_ddm_structure_id)>
...

${meta.getFieldLabel("Column1", locale)}




I get the following error in my adt:

No signature of method getStructure matches the arguments


If you want the actual value from a given DDLRecord, you'd use ${record.getFieldValue("assignedTo", locale)}.

But if I understand you correctly, you want the name of the field ("Assigned To" or "Field Label") which is an odd request, but these are simply localized strings coming from the translation resources of Liferay itself.

So you can use ${languageUtil.get(locale, 'assigned-to')} for example.
9年前 に Pierre-François Fiat によって更新されました。

RE: Dynamic Data List Template: Get field label

New Member 投稿: 11 参加年月日: 14/07/25 最新の投稿
What I want to do is displaying my articles with a table (though a adt).

So I need the metadata stored in the DDMStructure. And I need the structureId (or structureKey) to retrieve these details.

thank you for you help emoticon