Fórum

DDL Display templates and missing serviceLocator

thumbnail
Armaz Mellati, modificado 7 Anos atrás.

DDL Display templates and missing serviceLocator

Junior Member Postagens: 96 Data de Entrada: 30/10/09 Postagens Recentes
Hi

I am trying to make a Display Template for my Dynamic data list.
I am following the documentation :
https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/make-it-pretty-creating-custom-displays

However I get this Error :
Expression serviceLocator is undefined on line 12


Which is referring to this line, directly copied from the documentation :
<#assign DDLRecordLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService")>
<#assign records = DDLRecordLocalService.getRecords(reserved_record_set_id)>


What am I missing ? I wonder why would I need to use a serviceLocator at all ? Why couldn´t the "records" variable be pre-defined ?
I am missing something here ?
Thanx in advance.