Trigger Event after values have been commited for validation purposes
Posted
by www.jefferyfernandez.id.au
on Stack Overflow
See other posts from Stack Overflow
or by www.jefferyfernandez.id.au
Published on 2010-04-22T23:24:02Z
Indexed on
2010/04/22
23:33 UTC
Read the original article
Hit count: 171
flex
|event-handling
I have a Flex component with a form and on creationComplete, I load some data onto the form textInputs. After the Form TextInputs have got their values, I want to trigger an event so the Parent of the component can validate the values on the TextInputs and based on the validation results, I perform some enable/disable of other interfaces.
I have the following dispatch code:
this.dispatchEvent(new PersonalDetailsEvent(PersonalDetailsEvent.LOADED_DATA_EVENT));
The event is dispatched and is captured by the parent. But upon performing the validation, some TextInputs always fail the validation. I thought it could be because of a race condition and so I used callLater() with same results. So in the end I am now using a timer to dispatch the event which is not ideal. Does anyone have a solution to this problem. It is really annoying that a timer needs to be used for this scenario.
© Stack Overflow or respective owner