public interface FormValidationTrigger
Definition of an interface for objects that can trigger the validation of a form.
Validation of user input can make sense at different points of time, for instance only when the user hits the OK button, after an input field was left, or even while typing into an input field. It is up to a specific application to decide when validation should be performed. The user should get an early feedback about errors in the data entered, but on the other hand being overwhelmed by a multitude of validation error messages does not improve the usability of the software either.
Because there are many different approaches to this problem a
FormController
does not determine itself when to
initiate a validation operation, but delegates this task to a
FormValidationTrigger
implementation. So it is possible to
choose the validation strategy dynamically.
This interface only defines an initialization method. The idea is that a concrete implementation registers itself as event listener for the corresponding events. When it receives an event that should cause a validation, it can trigger the controller. This approach frees the controller from having to poll the trigger on a regular basis.
Modifier and Type | Method and Description |
---|---|
void |
initTrigger(FormController controller)
Initializes this validation trigger and registers the associated form
controller.
|
void initTrigger(FormController controller)
controller
- the associated form controllerCopyright © 2016 The JGUIraffe Team. All rights reserved.