/** * 用于一个页面有多个extremeTable是使用 * * @param tableId 等于extremeTable的tableId属性 */ public void savePage(String tableId, Page page, PageRequest pageRequest) { Assert.notNull(tableId, "tableId must be not null"); Assert.notNull(page, "page must be not null"); getRequest().setAttribute(tableId + "page", page); getRequest().setAttribute(tableId + "totalRows", new Integer(page.getTotalCount())); getRequest().setAttribute(tableId + "pageRequest", pageRequest); getRequest().setAttribute(tableId + "query", pageRequest); }
public String listAjax() { CmsRequestlogQuery query = newQuery(CmsRequestlogQuery.class, DEFAULT_SORT_COLUMNS); String sort = this.getRequest().getParameter("sort"); if (StringUtils.isNotEmpty(sort)) query.setSortColumns(sort); Page page = cmsRequestlogManager.findPage(query); Map map = new HashMap(); map.put("total", page.getTotalCount()); map.put("rows", page.getResult()); return writeAjaxResponse(Json.toJson(map)); }