与几个Searchcontainer分页

时间:2013-10-07 09:46:46

标签: pagination liferay-6

尝试如何通过byi独立实现Pagination将几个Searchcontainer映射到容器页面。

这里有2个Searchcontainer,显示不同的列表。 我需要在第一个Searchcontainer中更改页面,而不是在第二个页面中更改页面。(反之亦然)

 <aui:form action="<%= renderURL.toString()%>" method="post" name="fm" showEmptyOption="<%= true%>">
        <div>
            <%
                List list = ServiceOrderSearchUtil.simpleSearch(themeDisplay, keywords, serviceOrdersForUserExt);
                int count = ServiceOrderSearchUtil.searchCount();
            %>
            <liferay-ui:panel-container extended="true" accordion="true" id="lfrpc1">
                <liferay-ui:panel title='<%= LanguageUtil.get(pageContext, "MaisOrders") + " (" + count + ")"%>' collapsible="true" defaultState="open" id="lfrp1" > 
                    <liferay-ui:search-container  iteratorURL="<%= iterURL%>" emptyResultsMessage="no-service-orders-were-found" delta="<%= delta%>">
                        <liferay-ui:search-container-results>
                            <%
                                results = list;
                                total = count;
                                results = ListUtil.subList(results, searchContainer.getStart(), searchContainer.getEnd());
                                pageContext.setAttribute("results", results);
                                pageContext.setAttribute("total", total);
                            %>
                        </liferay-ui:search-container-results>
                            <%@ include file="/jsp/dizo-chief-panel/serviceorder_columns.jspf"%>
                        <liferay-ui:search-iterator searchContainer="<%= searchContainer%>" paginate="true" />
                    </liferay-ui:search-container>
                </liferay-ui:panel>
            </liferay-ui:panel-container>
        </div>
        <div>
            <%
                list = ServiceOrderSearchUtil.simpleSearchMV(themeDisplay, keywords, serviceOrdersExt);
                count = ServiceOrderSearchUtil.searchCount();
            %>
            <liferay-ui:panel-container extended="true" accordion="true" id="lfrpc2">
                <liferay-ui:panel title='<%= LanguageUtil.get(pageContext, "MVRequests") + " (" + count + ")"%>' collapsible="true" defaultState="close" id="lfrp2" > 
                    <liferay-ui:search-container  iteratorURL="<%= iterURL%>" emptyResultsMessage="no-service-orders-were-found" delta="<%= delta%>">
                        <liferay-ui:search-container-results>
                            <%
                                results = list;
                                total = count;
                                results = ListUtil.subList(results, searchContainer.getStart(), searchContainer.getEnd());
                                pageContext.setAttribute("results", results);
                                pageContext.setAttribute("total", total);
                            %>
                        </liferay-ui:search-container-results>
                            <%@ include file="serviceorder_columns.jspf"%>
                            <liferay-ui:search-iterator searchContainer="<%= searchContainer%>" paginate="false" />
                    </liferay-ui:search-container>
                </liferay-ui:panel>
            </liferay-ui:panel-container>
        </div>
    </aui:form>
抱歉我的英语;)

1 个答案:

答案 0 :(得分:1)

您需要使用2个Iterator Urls,每个搜索容器一个,然后在每个搜索中使用'curParam':容器

例如:

String table1Cur = ParamUtil.getString(renderRequest,"table1Cur");

PortletURL table1Url = renderResponse.createRenderURL();
table1Url.setParameter("table1Cur", table1Cur);

<liferay-ui:search-container id="Table1Search" iteratorURL="<%= table1Url %>" curParam="table1Cur" >