Fórumok

Dynamic Data List Template: Get field label

thumbnail
Afif Abu Bakar, módosítva 10 év-val korábban

Dynamic Data List Template: Get field label

Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2012.08.06. Legújabb bejegyzések
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.


Bradley Wood, módosítva 10 év-val korábban

RE: Dynamic Data List Template: Get field label

thumbnail
Afif Abu Bakar, módosítva 10 év-val korábban

RE: Dynamic Data List Template: Get field label

Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2012.08.06. Legújabb bejegyzések
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
Arun Kulasegaran, módosítva 10 év-val korábban

RE: Dynamic Data List Template: Get field label

New Member Bejegyzések: 8 Csatlakozás dátuma: 2013.08.23. Legújabb bejegyzések
Hi,
I'm new to liferay. Can u help me in validating dynamic data list fields before submitting it. Its Urgent
thumbnail
Afif Abu Bakar, módosítva 10 év-val korábban

RE: Dynamic Data List Template: Get field label

Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2012.08.06. Legújabb bejegyzések
Anyone can help me with this? I just want to get the value for label.
Tomas Augustaitis, módosítva 9 év-val korábban

RE: Dynamic Data List Template: Get field label

New Member Bejegyzések: 6 Csatlakozás dátuma: 2013.10.15. Legújabb bejegyzések
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)}

Pierre-François Fiat, módosítva 9 év-val korábban

RE: Dynamic Data List Template: Get field label

New Member Bejegyzések: 11 Csatlakozás dátuma: 2014.07.25. Legújabb bejegyzések
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
James Falkner, módosítva 9 év-val korábban

RE: Dynamic Data List Template: Get field label

Liferay Legend Bejegyzések: 1399 Csatlakozás dátuma: 2010.09.17. Legújabb bejegyzések
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.
Pierre-François Fiat, módosítva 9 év-val korábban

RE: Dynamic Data List Template: Get field label

New Member Bejegyzések: 11 Csatlakozás dátuma: 2014.07.25. Legújabb bejegyzések
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