Issue Details (XML | Word | Printable)

Key: DISPL-304
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Reporter: Emmanuel
Votes: 5
Watchers: 7
Operations

If you were logged in you would be able to see more operations.
DisplayTag

External paging paging.banner.some_items_found displays 1-10 in the second page (other pages as well)

Created: 08/Mar/06 09:16 AM   Updated: 01/Dec/08 01:28 PM   Resolved: 24/Aug/07 12:57 AM
Return to search
Component/s: Paging/Sorting
Affects Version/s: 1.1
Fix Version/s: 1.2

Time Tracking:
Not Specified

File Attachments: 1. Text File patch-displ-304.txt (2 kB)


Application server: Tomcat 5.0.28


 Description  « Hide
I'm using external paging using , I am not using the interface (first way to do it) just using getting the parameters and sending the partialList to the table.
parameter = request.getParameter ( new ParamEncoder(tableName).encodeParameterName( parameter ) );

the property paging.banner.some_items_found displays 1-10 when I go to the other pages. e.g.
116 items found, displaying 1-10.
Pages: 1 (2) 3 4 5 6 7 8

is there a property or something I need to set in order to show the proper numbers e.g. 20-30
thanks in advance


fabrizio giustina made changes - 09/Mar/06 03:34 PM
Field Original Value New Value
Fix Version/s 1.1.1 [ 12450 ]
Kevin Conaway added a comment - 15/Mar/06 12:44 PM
I am experiencing this issue as well. From what I can see, the cause of the issue is in SmartListHelper.getFirstIndexForPage(). If partiaList is true, this function will always return 0. Similarly, SmartListHelper.getLastIndexForPage() returns the page size. The comment inside getLastIndexForPage() is:

// return the min of pageSize or list size on the off chance they gave us more data than pageSize allows
return Math.min(this.pageSize - 1, this.fullList.size() - 1);

It seems that these functions are necessary because SmartListHelper.getListForPage() uses both of these methods to determine the "sublist" to display.

However, these numbers do NOT seem appropriate for the "search" banner returned by SmartListHelper.getSearchResultsSummary(). In this method, I think its best to compute the "indices" differently possibly using a combination of the current page and the page size.

Please advise. Thanks,

Kevin

Kevin Conaway added a comment - 15/Mar/06 02:00 PM
I am attaching a patch which I believe fixes this issue.

At the heart of the problem is SmartListHelper.getLastIndexForPage() and SmartListHelper.getFirstIndexForPage(). These calls should not be differentiating between partial and non-partial lists. To the best of my knowledge, they only made this difference for the benefit of SmarListHelper.getListForPage().

I moved the special case code out of SmartListHelper.getLastIndexForPage() and SmartListHelper.getFirstIndexForPage() and into SmarListHelper.getListForPage().

This appears to fix this issue.

Kevin

Kevin Conaway made changes - 15/Mar/06 02:00 PM
Attachment patch-displ-304.txt [ 19631 ]
Emmanuel added a comment - 15/Mar/06 03:08 PM
Thanks Kevin for submitting the patch, I tried it and it works also for me.
Emmanuel

Dave Knipp added a comment - 16/Apr/07 03:10 PM
just wanted to comment that I encountered the same issue.... almost a year after the issue was first reported.....

Is there anyone working to fix bugs on this project?


Kevin Conaway added a comment - 17/Apr/07 07:16 AM
Hi Dave,

If you're unable to apply the patch that I attached to this issue, I would be happy to mail you my patched jar file that we've been using for a year or so now. You can reach me: kevin dot a dot conaway at gmail dot com

Dave Knipp added a comment - 17/Apr/07 09:27 AM
Kevin, thanks!! I just sent you an email.

wilfried added a comment - 11/Jun/07 01:03 PM
Hi,

I'm also facing this issue but i'm unable to apply the patch attached to it.

Can somebody please send me a jar file with this issue fixed?

Thanks a lot,

ps: i'm reachable at: wbcharpentier@avantias.com

fabrizio giustina made changes - 14/Aug/07 04:48 PM
Fix Version/s 1.1.1 [ 12450 ]
Fix Version/s 1.1.2 [ 13662 ]
John Newman added a comment - 16/Aug/07 02:38 PM
Is anyone going to do anything about this one? hello? mc fly!

sorry to be a nag. I hope that patch works.

John Newman added a comment - 16/Aug/07 03:18 PM
after some hacking i was able to apply the patch, since it looks like this project is not very active, if anyone needs a copy click on my name & i can email it.

thanks for the patch!

fabrizio giustina added a comment - 24/Aug/07 12:57 AM
fix applied and testcase added, will be available in the 1.1.2 release. Thanks

fabrizio giustina made changes - 24/Aug/07 12:57 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
pankaj bonde added a comment - 22/Sep/08 06:04 AM
we are facing this issue with displaytag 1.1.1 version. we are not able to apply this patch.
can you please send me patch applied jar file.
It's urgent for me.

Marlon Williams added a comment - 01/Dec/08 01:28 PM
Hey, I am also having the same issue with displaytag 1.1.1 version. Is it possible for someone to send me this patch in a jar.