Search in sources :

Example 1 with LinkBuilder

use of com.koubei.web.tag.pager.LinkBuilder in project tis by qlangtech.

the class BasicModule method createPager.

protected Pager createPager() {
    Pager pager = Pager.register("page", new LinkBuilder() {

        @Override
        public StringBuffer getPagerUrl() {
            return BasicModule.this.getPagerUrl();
        }

        @Override
        public final StringBuffer getPageUrl(int page) {
            StringBuffer url = new StringBuffer(this.getPagerUrl());
            if (url.toString().indexOf("?") >= 0) {
                url.append("&");
            } else {
                url.append("?");
            }
            url.append("page=").append(page);
            return url;
        }
    }, this.getRequest());
    pager.setSchema("k1");
    pager.setRowsPerPage(PAGE_SIZE);
    pager.setCurPage(this.getPage());
    return pager;
}
Also used : Pager(com.koubei.web.tag.pager.Pager) LinkBuilder(com.koubei.web.tag.pager.LinkBuilder)

Aggregations

LinkBuilder (com.koubei.web.tag.pager.LinkBuilder)1 Pager (com.koubei.web.tag.pager.Pager)1