I want to display images which are present in the liferay Document Library.
How should I iterate to get all the images and display them?
The code that I have right now is :
<portlet:renderURL var="viewImageDataURL"/>
<liferay-ui:search-container delta="20" emptyResultsMessage="No Results Found">
<liferay-ui:search-container-results
total="<%= employeeImages.size() %>"
results="<%= ListUtil.subList(employeeImages, searchContainer.getStart(), searchContainer.getEnd()) %>" />
<liferay-ui:search-container-row modelVar="search"
className="com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil">
<liferay-ui:search-container-column-text
name="ImageName"
value = '<img src="<%=search.getDLFileEntry(1)%>"/>'>
</liferay-ui:search-container-column-text>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator searchContainer="<%=searchContainer %>" paginate="<%=true%>" />
</liferay-ui:search-container>
How should I iterate? The function to diplay images from Document Library is getDLFileEntry(fileId)
, I want to display all the values.
Edited Code:
The code I used is:
<portlet:renderURL var="viewImageDataURL"/>
<liferay-ui:search-container delta="20" emptyResultsMessage="No Results Found">
<liferay-ui:search-container-results
total="<%=DLFileEntryLocalServiceUtil.getDLFileEntriesCount() %>"
results="<%=DLFileEntryLocalServiceUtil.getFileEntries(searchContainer.getStart(), searchContainer.getEnd())%>" />
<liferay-ui:search-container-row
modelVar="search"
className="com.liferay.portlet.documentlibrary.model.impl.DLFileEntry">
<liferay-ui:search-container-column-text
name="ImageName"
value = '<img src="<%=search.getDLFileEntries(searchContainer.getStart(), searchContainer.getEnd())%>"/>'>
</liferay-ui:search-container-column-text>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator searchContainer="<%=searchContainer %>" paginate="<%=true%>" />
</liferay-ui:search-container>
The error is shown in the line below:
and the error description is:
com.liferay.portlet.documentlibrary.model.impl.DLFileEntry cannot be resolved to a type