Link to view - Dynamic Data List Freemarker Template - Liferay

1.1k Views Asked by At

I'm creating a freemarker template for a dynamic data list in Liferay. Now, I would like to redirect to view entry / record on clicking the link in this data list.

Actually I hava a view button, which works fine. But I wonder how could I do this using link. I tried to make <a href="${portletActionURL}"> but this didn't work.

My code for the view button:

<td>
    <#assign controlPanelGroup = groupService.getGroup(portalUtil.getDefaultCompanyId(), "Control Panel")><#assign controlPanelPlid = layoutLocalService.getDefaultPlid(controlPanelGroup.getGroupId(), true)><#assign portletActionURL = portletURLFactory.create(request,"167",controlPanelPlid,"ACTION_PHASE")>
        ${portletActionURL.setParameter("recordId", "${cur_record.getRecordId()}")}
        ${portletActionURL.setParameter("struts_action", "/dynamic_data_lists/view_record")}
        ${portletActionURL.setParameter("redirect", "${themeDisplay.getPortalURL()}${themeDisplay.getURLCurrent()}")}

    <#if permissionChecker.hasPermission(scopeGroupId, "com.liferay.portlet.dynamicdatalists.model.DDLRecordSet", "${reserved_record_set_id}", "VIEW")>
    <form action="${portletActionURL}" method="POST">
        <input type="submit" value="view">
    </form>
    </#if>
</td>

Do you guys have any ideas?

0

There are 0 best solutions below