Message: A new issue has been created in JIRA.
--------------------------------------------------------------------- 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: Unassigned Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: DisplayTag Components: HTML Generation Versions: 1.0 RC1 Assignee: Reporter: fabrizio giustina Created: Sun, 14 Nov 2004 2:58 PM Updated: Sun, 14 Nov 2004 2:58 PM 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 ------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ displaytag-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-devel