this.endProcessing = null;
this.isValid = false;
// Notify the end of the current phase
if (this.listener != null) {
this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
}
this.phase = ProcessingPhase.READ_FROM_REQUEST;
// Find the submit widget, if not an action
this.submitWidget = null;
String submitId = formContext.getRequest().getParameter("woody_submit_id");
if (submitId != null && submitId.length() > 0) {
StringTokenizer stok = new StringTokenizer(submitId, ".");
Widget submit = this;
while (stok.hasMoreTokens()) {
submit = submit.getWidget(stok.nextToken());
if (submit == null) {
throw new IllegalArgumentException("Invalid submit id (no such widget): " + submitId);
}
}
setSubmitWidget(submit);
}
doReadFromRequest(formContext);
fireWidgetEvents();
// Notify the form handler, if any
if (formContext.getActionEvent() != null && formHandler != null) {
formHandler.handleActionEvent(formContext, formContext.getActionEvent());
}
// Notify the end of the current phase
if (this.listener != null) {
this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
}
if (this.endProcessing != null) {
return this.endProcessing.booleanValue();
}
// Validate the form
this.phase = ProcessingPhase.VALIDATE;
this.isValid = doValidate(formContext);
if (this.endProcessing != null) {
return this.endProcessing.booleanValue();
}
// Notify the end of the current phase
if (this.listener != null) {
this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
}
if (this.endProcessing != null) {
// De-validate the form if one of the listeners asked to end the processing
// This allows for additional application-level validation.