Message:
The following issue has been closed.
Resolver: fabrizio giustina
Date: Thu, 30 Dec 2004 7:43 AM
fixed in cvs for 1.0.
I initially thought to add a new property to control the paging behavior
(centered|standard) but since after some investigations the current output
sounds pretty random to a user point of view, I decided to use this as the
default.
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/DISPL-109
Here is an overview of the issue:
---------------------------------------------------------------------
Key: DISPL-109
Summary: Center of paging banner number
Type: Improvement
Status: Closed
Priority: Minor
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: DisplayTag
Components:
HTML Generation
Fix Fors:
1.0
Versions:
1.0 RC1
Assignee: fabrizio giustina
Reporter: fabrizio giustina
Created: Sun, 14 Nov 2004 2:58 PM
Updated: Thu, 30 Dec 2004 7:43 AM
Description:
====
imported from sf tracker
id 775939
submitted by Paul N Miller - paul_n_miller
http://sourceforge.net/support/tracker.php?aid=775939
====
The default paging has the current page as the first or
last element in the "paging.banner.group_size".
I want it centered allowing the user to move
forward/backwards
at a greater rate.
IE where [X] is the currentPage
the default: [First/Prev] [7], 8, 9, 10, 11, 12,
13, 14 [Next/Last]
centered: [First/Prev] 7, 8, 9, 10, [11], 12,
13, 14 [Next/Last]
works best with an odd "paging.banner.group_size"
Add the below to SmartListHelper.java
(The patch is not very readable)
startPage = currentPage - maxPages/2;
if (startPage < 1) {
startPage = 1;
}
endPage = startPage + maxPages-1;
if (endPage > pageCount) {
startPage -= (endPage - pageCount);
endPage = pageCount;
}
diff -u -d -b -w -r1.1.2.2 SmartListHelper.java
--- SmartListHelper.java 20 Jun 2003 14:36:52 -0000 1.1.2.2
+++ SmartListHelper.java 22 Jul 2003 21:58:31 -0000
@@ -250,20 +250,14 @@
if( pageCount == 1 || pageCount == 0 ) {
return "<b>1</b>";
}
-
- if( currentPage < maxPages ) {
+ startPage = currentPage - maxPages/2;
+ if (startPage < 1) {
startPage = 1;
- endPage = maxPages;
- if( pageCount < endPage ) {
- endPage = pageCount;
- }
- } else {
- startPage = currentPage;
- while( startPage + maxPages > ( pageCount + 1
) ) {
- startPage--;
}
-
- endPage = startPage + ( maxPages - 1 );
+ endPage = startPage + maxPages-1;
+ if (endPage > pageCount) {
+ startPage -= (endPage - pageCount);
+ endPage = pageCount;
}
boolean includeFirstLast = prop.getProperty(
"paging.banner.include_first_last" ).equals( "true" );
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
displaytag-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel