| Flex 2 Developer's Guide > Flex Data Features > Validating Data > Working with validation events | |||
Flex gives you two ways to listen for validation events:
Flex components dispatch valid and invalid events, depending on the results of the validation. This lets you listen for the events being dispatched from the component being validated, and perform any additional processing on the component based on its validation result.
The event object passed to the event listener is of type Event. For more information, including an example, see Explicitly handling component validation events.
All validators dispatch valid or invalid events, depending on the results of the validation. You can listen for these events, and then perform any additional processing as required by your validator.
The event object passed to the event listener is of type ValidationResultEvent. For more information, including an example, see Explicitly handing validator validation events.
You are not required to listen for validation events. When these events occur, by default, Flex changes the appropriate border color of the target component, displays an error message for an invalid event, or hides any previous error message for a valid event.
Flex 2.01