Daniel,

> Or we will be querying backend only for the desired 50 records?
> And if so how we take care for sorting, page number etc. ?

Query only what you need. You need to pass information to your data layer of what is the starting record plus the number of records you want.... so perhaps you're going to display items 50-75 of 200. Devise a plan to do that.

> Can someone give me some example code (what to put in the JSP, the
> action, dao, etc)

You need to construct a method-local class of type PaginatedList and populate values about the list:

final YourResults results = ...;
PaginatedList versePage = new PaginatedList() {
    public int getFullListSize() {
        return results.getTotal();
    }

    public List getList() {
        return results.getMyData();
    }

    public int getObjectsPerPage() {
        return results.getPageSize();
    }

    public int getPageNumber() {
        return page;
    }

    public String getSearchId() {
        return null;
    }

    public String getSortCriterion() {
        return null;
    }

    public SortOrderEnum getSortDirection() {
        return SortOrderEnum.DESCENDING;
    }
};

The YourResults object is whatever you have retrieved from your data layer. Then stick the object into the request and use it in the "name" attribute of your table. Please see the display tag examples for this:

http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to