* @todo DO IT WIHTOUT JAVASCRIPT!
*/
protected void renderItemsPerPage(StringBuffer sb, HashMap itemsPerPageParameters) throws NoSuchMessageException, JspException
{
Locale locale = getLocale();
ValueListInfo valueListInfo = getValueListInfo();
TableInfo tableInfo = getTableInfo();
itemsPerPageParameters.remove(ValueListInfo.PAGING_NUMBER_PER + tableInfo.getId());
itemsPerPageParameters.put(ValueListInfo.PAGING_PAGE + tableInfo.getId(), String.valueOf(valueListInfo.getPagingPage()));
if (valueListInfo.isFocusEnabled())
{
itemsPerPageParameters.put(ValueListInfo.DO_FOCUS + tableInfo.getId(), valueListInfo.isDoFocusAgain() ? "true" : "false");
if (valueListInfo.getFocusProperty() != null)
{
itemsPerPageParameters.put(ValueListInfo.FOCUS_PROPERTY + tableInfo.getId(), valueListInfo.getFocusProperty());
}
if (valueListInfo.getFocusValue() != null)
{
itemsPerPageParameters.put(ValueListInfo.FOCUS_VALUE + tableInfo.getId(), valueListInfo.getFocusValue());
}
}
String propertyName = ValueListInfo.PAGING_NUMBER_PER + tableInfo.getId();
String delim = getMessage("paging.delim", null, "", locale);
sb.append(delim);
final String stylePrefix = getConfig().getStylePrefix();
final String commonStyle = stylePrefix + ITEMS_PER_PAGE_STYLE + " " + ITEMS_PER_PAGE_STYLE;
final String labelStyle = stylePrefix + LABEL_STYLE + " " + LABEL_STYLE;
final String inputBoxStyle = stylePrefix + INPUT_BOX_STYLE + " " + INPUT_BOX_STYLE;
final String submitButtonStyle = stylePrefix + SUBMIT_BUTTON_STYLE + " " + SUBMIT_BUTTON_STYLE;
if (isGenerateItemsPerPageForm())
{
sb.append("<form action='#' onsubmit='return false;' class='").append(commonStyle).append("'>");
}
sb.append("<table border='0' cellspacing='0' cellpadding='0' class='").append(commonStyle).append("'>");
sb.append("\n <tr class='").append(commonStyle).append("'>");
Map labelAttrs = new HashMap();
labelAttrs.put("class", labelStyle);
sb.append("\n <td nowrap='true' class='").append(labelStyle).append("'>");
renderPerPageLabel(sb, labelAttrs, getMessage("paging.itemsPerPage.label", null, locale));
sb.append("</td>");
Map inputBoxAttrs = new HashMap();
inputBoxAttrs.put("id", propertyName);
inputBoxAttrs.put("name", propertyName);
inputBoxAttrs.put("class", inputBoxStyle);
inputBoxAttrs.put("title", getMessage("paging.itemsPerPage.title", null, locale));
inputBoxAttrs.put("value", new Integer(valueListInfo.getPagingNumberPer()));
sb.append("\n <td class='").append(inputBoxStyle).append("'>");
renderPerPageInputBox(sb, inputBoxAttrs);
sb.append("</td>");