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.pag ination.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



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to