分页不起作用,没有错误消息

时间:2014-02-13 05:43:23

标签: liferay-6

文件中没有错误但是我部署后下面的代码无法正常工作请检查一下代码并帮助我。该表是“库”,列是“标题”和“作者”。 view.jsp中的代码如下所示

           <%   List<Library> list = LibraryLocalServiceUtil.getLibraries(-1, -1); %>
                 <liferay-ui:search-container delta="5" emptyResultsMessage="No Books Available">
                  <liferay-ui:search-container-results results="<%= ListUtil .subList(list, searchContainer.getStart(),searchContainer.getEnd()) %>" total="<%= list.size() %>" />
                  <liferay-ui:search-container-row
                  className="com.liferay.pagi.model.Library"
                   modelVar="aLibrary">
                  <liferay-ui:search-container-column-text property="title" />
                  <liferay-ui:search-container-column-text property="author" />
                  </liferay-ui:search-container-row>
                  <liferay-ui:search-iterator />
                  </liferay-ui:search-container>
        You will get all book titles and author names are show into the table.

        Give a link back to the main page.

                   <a href="<portlet:renderURL/>">&laquo; Go Back</a>

1 个答案:

答案 0 :(得分:0)

以下是工作portlet只需下载并与您的代码进行比较.. 我的客人列表可能是0或空。检查

List<Library> list = LibraryLocalServiceUtil.getLibraries(0,LibraryLocalServiceUtil.getCount());

http://www.liferaysavvy.com/2013/03/liferay-search-container-with-curd.html https://github.com/liferay/liferay-plugins/tree/6.2.x/portlets/sample-ui-search-container-taglib-portlet