Tips&Tricks: Flex Cairngorm Sequence Command, sequencing events
Posted by Jai on August 18, 2009
Lets say you want to sequence two events and the second one is triggered based on some criteria. First event get list of all the list data and second event gets data for a user on selection. The criteria is that before getting the user data the total list data should be present.
import org.springextensions.actionscript.cairngorm.EventSequence; var sequence:EventSequence = new EventSequence(); sequence.addSequenceEvent(TestBaseEvent,[TestBaseEvent.GET_ALL_DATA]); sequence.addSequenceEvent(GetUserDataEvent, [userId],[new Property(userModel,"users")]); sequence.dispatch();
The addSequenceEvent method takes floowing parameters:
First – Event class name
Second – the event constructor parameter array
Third – The trigger criteria, once the criteria passes only then the second event is called.
For more details, see EventSequence.