Resubmitting this from a better email address...
Jeremy

Begin forwarded message:

From: Incoming Bulk Mail <[EMAIL PROTECTED]>
Date: February 17, 2004 1:07:20 PM PST
To: [EMAIL PROTECTED]
Subject: Displaytag contribution?

Hi,
I'm pretty new to the OSS world. I used displaytags to do some layout for a project I've been working on. I made a modification to the displaytags source code that I think would be useful to others.

Currently, displaytags does not allow you to change the format of the pagination nav bar links (as seen by the browser user)... it looks like this:

[first/prev] 2, 3, 4 [next/last]

For our project, a PRD specified this look:

<< previous 21-40 | 41-60 | 61-68 next >>

The only part that can't be done in the current code-base is the page-labels themselves ( 21-40, etc)

I've added a new attribute to the 'display:table' tag called 'paginationDecorator' that works in a similar fashion to the 'decorator' tag. Here's an implementation of the PaginationDecorator interface (below). Note: I also modified NumberedPage so that it contains the method 'getItemCount' which is calculated in a new method 'computedPageItemCount(int page)' within SmartListHelper.

/**
* @author jeremy
*/
public class SearchResultsPaginationDecorator implements PaginationDecorator {

/* (non-Javadoc)
* @see org.displaytag.decorator.PaginationDecorator#decorate(org.displaytag.pagination.NumberedPage, int)
*/
public String decorate(NumberedPage page, int pageSize) {
int first = (page.getNumber()-1)*pageSize+1;
int last = first+page.getItemCount()-1;
return "" + first + "-" + last;
}
}

Here are my questions:
1) Would this be useful to displaytag users?
2) Who do I submit the changes to?
3) What exactly should I submit?

Jeremy

Reply via email to