我想显示存在于 liferay 文档库中的图像。
我应该如何迭代以获取所有图像并显示它们?
我现在拥有的代码是:
<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>
我应该如何迭代?从文档库显示图像的功能是getDLFileEntry(fileId)
,我想显示所有值。
编辑代码:
我使用的代码是:
<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>
错误显示在下面的行中:
错误描述是:
com.liferay.portlet.documentlibrary.model.impl.DLFileEntry 无法解析为类型