[ http://jira.codehaus.org/browse/DISPL-182?page=all ]
     
fabrizio giustina closed DISPL-182:
-----------------------------------

     Resolution: Duplicate
    Fix Version: 1.1

duplicate of DISPL-212 - already fixed for 1.1

> Empty list displayed when start offset == list length
> -----------------------------------------------------
>
>          Key: DISPL-182
>          URL: http://jira.codehaus.org/browse/DISPL-182
>      Project: DisplayTag
>         Type: Bug

>   Components: Paging/Sorting
>     Versions: 1.0
>     Reporter: Wannes Simons
>     Priority: Minor
>      Fix For: 1.1

>
>
> In the unfortunate event that the starting offset is the same as the number 
> of items in the list, an empty page is shown.
> This error occurs when the page number is saved in the session (using a 
> custom RequestHelper) and the last item on the page is deleted. E.g. there 
> are two pages and the last item on the second page is deleted. The pagenumber 
> is still '2', but all items are shown on the first page, so the result is an 
> empty list.
> The fix is very easy. In the TableTag, the initParameters() method, the 
> invalid page check should be this:
> ----------------------------------------------
> // invalid page requested, go back to page one
> if (start >= fullSize){
>    start = 0;
> }
> -----------------------------------------------
> As you can see; when start == fullSize, start has to be changed as well, 
> because there should be at least 1 item on each page. Theoretically this 
> should work as well:
> ----------------------------------------------
> // invalid page requested, go back to the previous page
> while (start >= fullSize){
>    start = Math.max( start - this.pagesize, 0 );
> }
> -----------------------------------------------
> Making it go to the previous page, instead of the first in the list.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to