2014-10-22 100 views
0

我需要的一切工作正常,直到我面臨以下問題。 我正在使用displayTag來使用排序和分頁。但問題是,當我在第四頁上,例如,點擊任何列進行排序,然後控件默認返回第1頁。它應該只有第4頁(理想情況下)。以下是我寫的代碼。DisplayTag分頁排序後不保留

display.jsp

<div class="tableDisp"> 
       <display:table id="person" cellspacing="1" cellpadding="1" keepStatus="true" class="tableDisplay" excludedParams="*" requestURI="/getAllMember.htm" name="${command}" sort="list" pagesize="5" > 

        <display:column title="Name" sortable="true" sortProperty="personName" >${person.personName}</display:column> 
        <display:column title="DOB" sortable="true" sortProperty="dob" >${person.dob}</display:column> 
        <display:column title="phone Number" sortable="true" sortProperty="phoneNo" >${person.phoneNo}</display:column> 
        <display:column title="profile creation Date" sortable="true" sortProperty="profilecreationDate" >${person.profilecreationDate}</display:column> 
        <display:column title="Gender" sortable="true" sortProperty="gender" >${person.gender}</display:column> 

       </display:table> 
       </div> 

Contrller.java

List<Person> persons = searchService.getAllPerson(); 
      ModelAndView mav = new ModelAndView("memberPage"); 
      mav.addObject("command",persons); 
      return mav; 

我使用displayTag-1.2.jar。請幫忙。 謝謝

回答

0

我假設你想對整個列表進行排序並保留在當前頁面上,而不是隻對當前頁面進行排序(可以通過指定排序=「頁面」來完成)。

如果看起來像你是運氣不好。請參見下面的演示和評論,低於該注意的是:

當排序的完整列表上啓用,頁碼是 如果更改排序的列或排序順序自動復位。

http://demo.displaytag.org/displaytag-examples-1.2/example-pse.jsp?d-49653-s=0&d-49653-o=2&d-49653-p=1

+0

那麼說的話是這個要求是不可能的..? – 2014-10-23 09:08:04