2016-05-12 5 views
0

何が間違っていますか? Liferay Dynamic Data Listポートレット内に表示する値を取得できません。テンプレートコードは次のとおりです。現在、ヘッダの後には何も表示されません。しかし、私はレンダリングされたHTMLの中にclosing tableタグを見る。動的データリストにデータがありません - Velocity Liferay

#set ($ddlRecordService = $serviceLocator.findService('com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService')) 
#set ($recordSetId = $getterUtil.getLong($reserved_record_set_id.data)) 
#set ($records = $ddlRecordService.getRecords($recordSetId)) 

<table class="table table-striped"> 
<caption>Audio files listing of FDR speeches</caption> 
<thead> 
    <tr> 
     <th>Date</th> 
     <th>Description</th> 
     <th>Tape information</th> 
    </tr> 
    </thead> 
<tbody> 
#foreach($record in $records) 

     #set ($audioDate = $record.getField("audioDate").getValue()) 
     #set ($audioDesc = $record.getField("audioDesc").getValue()) 
     #set ($audioLink = $record.getField("audioLink").getValue()) 
    <tr> 
     <td>$audioDate</td> 
     <td>$audioDesc</td> 
     <td>$audioLink</td> 
    </tr> 
    #end 
</tbody> 
</table> 
+0

「tr」が生成されていますか?そうでない場合は、あなたの '$ records'が空であるか、人口が集まらないと思います。 –

答えて

0

$recordsが空であるか、ベロシティコンテキストに追加されていません。

VelocityContext context = new VelocityContext(); 

context.put("records", your_records_list); 
関連する問題