adapforms.runtime.events
Interface InstanceCallback

All Known Implementing Classes:
AbstractInstanceCallback

public interface InstanceCallback

Callback that handles framework events from one or more FormInstances.

This allows the domain application to respond to events even while the form is still being filled in by the user.

The same callback object may be used for multiple instances, as the first argument to each event is the instance in question.

Author:
Henrik Gammelmark, geemark@cs.au.dk
See Also:
AbstractInstanceCallback

Method Summary
 void onStatusChange(FormInstance instance)
          The overall status of the form instance has just changed.
 void onSubmit(FormInstance instance)
          The user has submitted the form, and the domain application may choose to ignore it, or accept the submit.
 

Method Detail

onStatusChange

void onStatusChange(FormInstance instance)
The overall status of the form instance has just changed. Use the FormInstance.getStatusComplete() method to get the new status.


onSubmit

void onSubmit(FormInstance instance)
The user has submitted the form, and the domain application may choose to ignore it, or accept the submit.

Important: The form may still contain validation errors or may be incomplete. Use the FormInstance.getStatusComplete() method to determine this.

Most applications would most likely only accept forms if the status indicates that it has been completed entirely, but some applications may wish to store partially completed forms or similar.

Important: It is up to the domain application to decide if and how to give the user feedback on both ignored and accepted submissions.
You may wish to notify the user by calling FormInstance.displayMessageToUser(String), or possibly use a modality-specific adaptation or event.