heartbeat.begin();
try
{
ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(
componentEventResultProcessor);
resources.triggerContextEvent(PREPARE_FOR_SUBMIT, context, callback);
if (callback.isAborted()) return true;
resources.triggerContextEvent(PREPARE, context, callback);
if (callback.isAborted()) return true;
executeStoredActions();
heartbeat.end();
ValidationTracker tracker = environment.peek(ValidationTracker.class);
// Let the listeners peform any final validations
// Update through the parameter because the tracker has almost certainly changed
// internal state.
this.tracker = tracker;
formSupport.executeDeferred();
fireValidateFormEvent(context, callback);
if (callback.isAborted()) return true;
// Let the listeners know about overall success or failure. Most listeners fall into
// one of those two camps.
// If the tracker has no errors, then clear it of any input values
// as well, so that the next page render will be "clean" and show
// true persistent data, not value from the previous form submission.
if (!this.tracker.getHasErrors()) this.tracker.clear();
resources.triggerContextEvent(tracker.getHasErrors() ? FAILURE : SUCCESS, context, callback);
// Lastly, tell anyone whose interested that the form is completely submitted.
if (callback.isAborted()) return true;
resources.triggerContextEvent(SUBMIT, context, callback);
return callback.isAborted();
}
finally
{
environment.pop(Heartbeat.class);
environment.pop(FormSupport.class);