ActionLink controlLink = getControlLink();
boolean continueProcessing = super.onProcess();
if (!controlLink.isClicked() && getForm().isFormSubmission()) {
Field pageField = getForm().getField(PAGE);
pageField.onProcess();
if (StringUtils.isNotBlank(pageField.getValue())) {
setPageNumber(Integer.parseInt(pageField.getValue()));
}
Field columnField = getForm().getField(COLUMN);
columnField.onProcess();
setSortedColumn(columnField.getValue());
Field ascendingField = getForm().getField(ASCENDING);
ascendingField.onProcess();
setSortedAscending("true".equals(ascendingField.getValue()));
// Range sanity check
int pageNumber = Math.min(getPageNumber(), getRowList().size() - 1);
pageNumber = Math.max(pageNumber, 0);
setPageNumber(pageNumber);
//Have to sort list here before we process each field. Otherwise if
//sortRowList() is only called in Table.toString(), the fields values set here
//will not correspond to their rows in the rowList.
sortRowList();
int firstRow = getFirstRow();
int lastRow = getLastRow();
List rowList = getRowList();
List columnList = getColumnList();
for (int i = firstRow; i < lastRow; i++) {
Object row = rowList.get(i);
for (int j = 0; j < columnList.size(); j++) {
Column column = (Column) columnList.get(j);
if (column instanceof FieldColumn) {
FieldColumn fieldColumn = (FieldColumn) column;
Field field = fieldColumn.getField();
field.setName(column.getName() + "_" + i);
field.onProcess();
if (field.isValid()) {
fieldColumn.setProperty(row, column.getName(),
field.getValueObject());
} else {
getForm().setError(getMessage("formtable-error"));
}
}
}