DisplayTag

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

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 1.2
  • Component/s: Paging/Sorting
  • Labels:
    None
  • Application server:
    Tomcat 5.0.28

Description

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

Activity

Hide
Kevin Conaway added a comment -
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
Show
Kevin Conaway added a comment - 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
Hide
Kevin Conaway added a comment -
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
Show
Kevin Conaway added a comment - 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
Hide
Emmanuel added a comment -
Thanks Kevin for submitting the patch, I tried it and it works also for me.
Emmanuel
Show
Emmanuel added a comment - Thanks Kevin for submitting the patch, I tried it and it works also for me. Emmanuel
Hide
Dave Knipp added a comment -
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?

Show
Dave Knipp added a comment - 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?
Hide
Kevin Conaway added a comment -
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
Show
Kevin Conaway added a comment - 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
Hide
Dave Knipp added a comment -
Kevin, thanks!! I just sent you an email.
Show
Dave Knipp added a comment - Kevin, thanks!! I just sent you an email.
Hide
wilfried added a comment -
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
Show
wilfried added a comment - 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
Hide
John Newman added a comment -
Is anyone going to do anything about this one? hello? mc fly!

sorry to be a nag. I hope that patch works.
Show
John Newman added a comment - Is anyone going to do anything about this one? hello? mc fly! sorry to be a nag. I hope that patch works.
Hide
John Newman added a comment -
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!
Show
John Newman added a comment - 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!
Hide
fabrizio giustina added a comment -
fix applied and testcase added, will be available in the 1.1.2 release. Thanks
Show
fabrizio giustina added a comment - fix applied and testcase added, will be available in the 1.1.2 release. Thanks
Hide
pankaj bonde added a comment -
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.
Show
pankaj bonde added a comment - 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.
Hide
Marlon Williams added a comment -
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.
Show
Marlon Williams added a comment - 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.
Hide
Mauro added a comment -
Hi everyone,
I'm new in using displaytag.
I'm using 1.1 version and I have the following problem.

I have to fix a problem in code made by an other person.
We have to display a list of element paging it at 100 at 100 if the number of elements is more than 100.
The problem is that in the page 1 I see "1250 items found, diplayed from 1 to 100", but also in the second page, in the third and go on, I see the same message, instead I'd like to see "...displayed from 101 to 200", "...201 to 300" and etc.
I have seen that there is a property called "paging.banner.some_items_found" in the displaytag.property file and it's used to show that message, but it does not work correctly.

Can anyone help me to solve the problem? Thanks to all

Here are some parts of my code

in the jsp page
<display:table sort="external" requestURI="/abc.do?mth=paging&sensible=${param.sensible}"
name="sessionScope.abcList"
id="item"
pagesize="100"
htmlId="abcTable"
class="dataGrid"
style="border:0px;display:inline"
excludedParams="*"
decorator=""

partialList="true"
size="pageScope.pagListConf.totalList"
offset="${pagListConf.offSet}"
>

in the properties file
paging.banner.some_items_found="<div class="toolbar" id="displayNavigator">{0} {1} found, displayed from {2} to {3}"
Show
Mauro added a comment - Hi everyone, I'm new in using displaytag. I'm using 1.1 version and I have the following problem. I have to fix a problem in code made by an other person. We have to display a list of element paging it at 100 at 100 if the number of elements is more than 100. The problem is that in the page 1 I see "1250 items found, diplayed from 1 to 100", but also in the second page, in the third and go on, I see the same message, instead I'd like to see "...displayed from 101 to 200", "...201 to 300" and etc. I have seen that there is a property called "paging.banner.some_items_found" in the displaytag.property file and it's used to show that message, but it does not work correctly. Can anyone help me to solve the problem? Thanks to all Here are some parts of my code in the jsp page <display:table sort="external" requestURI="/abc.do?mth=paging&sensible=${param.sensible}" name="sessionScope.abcList" id="item" pagesize="100" htmlId="abcTable" class="dataGrid" style="border:0px;display:inline" excludedParams="*" decorator="" partialList="true" size="pageScope.pagListConf.totalList" offset="${pagListConf.offSet}" > in the properties file paging.banner.some_items_found="<div class="toolbar" id="displayNavigator">{0} {1} found, displayed from {2} to {3}"

People

Vote (5)
Watch (7)

Dates

  • Created:
    Updated:
    Resolved: