如何在liferay中的搜索容器中使用自定义bean类

时间:2013-07-31 13:11:09

标签: liferay liferay-6

我想在liferay portlet中显示一些记录 我有要显示的对象列表,为此我使用了liferay的Searchcontainer标记,即liferay-ui:search-container,如下所示:

<liferay-ui:search-container delta="5" emptyResultsMessage="No Results Found" iteratorURL="<%= portletURL %>" >
   <liferay-ui:search-container-results total="<%= contents.size() %>" results="<%= ListUtil.subList(contents,searchContainer.getStart(),searchContainer.getEnd()) %>"> 
   </liferay-ui:search-container-results>

   <liferay-ui:search-container-row modelVar="content"  keyProperty="title" className="com.liferay.portlet.documentlibrary.model.DLFileEntry">
        <liferay-ui:search-container-column-text name='Name' property="name" orderable="<%= true %>"></liferay-ui:search-container-column-text>
        <liferay-ui:search-container-column-text name='Title'   property="title" orderable="<%= true %>"></liferay-ui:search-container-column-text>
        <liferay-ui:search-container-column-text name='MimeType'   property="mimeType" orderable="<%= true %>"></liferay-ui:search-container-column-text>
        <liferay-ui:search-container-column-text name='CreatedDate'  orderableProperty="createDate"><%=ContentReportUtil.getCreatedDate(content) %></liferay-ui:search-container-column-text>
        <liferay-ui:search-container-column-text name='ModifiedDate'  orderableProperty="modifiedDate"><%=ContentReportUtil.getModifiedDate(content) %></liferay-ui:search-container-column-text>
    </liferay-ui:search-container-row>
   <liferay-ui:search-iterator/>
</liferay-ui:search-container>

目前我正在将myobject属性映射到DLFileEntry属性并从myobjects列表创建DLFileentry对象列表,但我知道这不是一个好方法,请建议解决方案。

0 个答案:

没有答案