掲示板

DDL Display templates and missing serviceLocator

thumbnail
7年前 に Armaz Mellati によって更新されました。

DDL Display templates and missing serviceLocator

Junior Member 投稿: 96 参加年月日: 09/10/30 最新の投稿
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.