protected void onSubmit(AjaxRequestTarget target, Form form) {
WebMarkupContainer gridRow = getGrid().findParentRow(SubmitCancelPanel.this);
final Boolean[] error = { false };
// first iteration - validate components
gridRow.visitChildren(FormComponent.class, new IVisitor<FormComponent<?>, Void>() {
public void component(FormComponent<?> formComponent, IVisit<Void> visit) {
if (formComponentActive(formComponent)) {
formComponent.validate();
if (formComponent.isValid()) {