// Handle row move. It's important for this to happen *after* row.readFromRequest,
// as reordering rows changes their IDs and therefore their child widget's ID too.
if (action.equals("move")) {
if (!this.orderable) {
throw new FormsRuntimeException("Widget " + this + " is not orderable",
getLocation());
}
int from = Integer.parseInt(req.getParameter(paramName + ".from"));
int before = Integer.parseInt(req.getParameter(paramName + ".before"));
Object row = this.rows.get(from);
// Add to the new location
this.rows.add(before, row);
// Remove from the previous one, taking into account potential location change
// because of the previous add()
if (before < from) from++;
this.rows.remove(from);
// Needs refresh
getForm().addWidgetUpdate(this);
} else {
throw new FormsRuntimeException("Unknown action " + action + " for " + this, getLocation());
}
}