HttpServletRequest request = (HttpServletRequest) context.get("request");
HttpServletResponse response = (HttpServletResponse) context.get("response");
ServletContext ctx = (ServletContext) request.getAttribute("servletContext");
RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
writer.append("<table border=\"0\" width=\"100%\" cellpadding=\"2\">\n");
writer.append(" <tr>\n");
writer.append(" <td align=\"right\">\n");
writer.append(" <b>\n");
if (viewIndex > 0) {
writer.append(" <a href=\"");
StringBuilder linkText = new StringBuilder(targetService);
if (linkText.indexOf("?") < 0) linkText.append("?");
else linkText.append("&");
//if (queryString != null && !queryString.equals("null")) linkText += queryString + "&";
if (UtilValidate.isNotEmpty(queryString)) {
linkText.append(queryString).append("&");
}
linkText.append("VIEW_SIZE_"+ paginatorNumber + "=").append(viewSize).append("&VIEW_INDEX_" + paginatorNumber + "=").append(viewIndex - 1).append("\"");
// make the link
writer.append(rh.makeLink(request, response, linkText.toString(), false, false, false));
String previous = UtilProperties.getMessage("CommonUiLabels", "CommonPrevious", (Locale) context.get("locale"));
writer.append(" class=\"buttontext\">[").append(previous).append("]</a>\n");
}
if (listSize > 0) {
Map<String, Integer> messageMap = UtilMisc.toMap("lowCount", Integer.valueOf(lowIndex + 1), "highCount", Integer.valueOf(lowIndex + actualPageSize), "total", Integer.valueOf(listSize));
String commonDisplaying = UtilProperties.getMessage("CommonUiLabels", "CommonDisplaying", messageMap, (Locale) context.get("locale"));
writer.append(" <span class=\"tabletext\">").append(commonDisplaying).append("</span> \n");
}
if (highIndex < listSize) {
writer.append(" <a href=\"");
StringBuilder linkText = new StringBuilder(targetService);
if (linkText.indexOf("?") < 0) linkText.append("?");
else linkText.append("&");
if (UtilValidate.isNotEmpty(queryString)) {
linkText.append(queryString).append("&");
}
linkText.append("VIEW_SIZE_" + paginatorNumber + "=").append(viewSize).append("&VIEW_INDEX_" + paginatorNumber + "=").append(viewIndex + 1).append("\"");
// make the link
writer.append(rh.makeLink(request, response, linkText.toString(), false, false, false));
String next = UtilProperties.getMessage("CommonUiLabels", "CommonNext", (Locale) context.get("locale"));
writer.append(" class=\"buttontext\">[").append(next).append("]</a>\n");
}
writer.append(" </b>\n");