This content has been marked as final. Show 7 replies
In Cairngorm when an event dispatched it is registered in the front controler. Again dispatching the sama event does not fires the event.
For usee it dispatch a new event.
Hope this helps
There shouldn't be any problem dispatching the event twice. Did you put trace statements in each trier, to ensure that the event is making a complete cycle?
I placed an alert.show statement inside getTransaction result function - the alert only pops up the first time getTransaction event is dispatched so I know that the second event didnt fire. The getTransaction event loads data into a DataGrid.
Is there something else I should do?
Doesn't the statement 'new CairngormEvent' create a brand new event? How do you think I can resolve the problem?
When you are adding addcommand(eventType, command class); in frontcontroller class, the eventType should be different from the previous one. Here if you pass the same name it shows the exception.
so every time you fire a event please change the event type you are passing to the function.
Hope this helps.
Yes I have created a brand new event (and also command) and everything is working now. However, I tried doing the following but it doesnt work (the refresh version doesnt work):
public class GetTransactionsEvent extends CairngormEvent
public static var EVENT_GET_TRANSACTIONS : String = "getTransactions";
public static var EVENT_GET_TRANSACTIONS_REFRESH : String = "getTransactionsRefresh";
addCommand( GetTransactionsEvent.EVENT_GET_TRANSACTIONS, GetTransactionsCommand);
addCommand(GetTransactionsEvent.EVENT_GET_TRANSACTIONS_REFRESH, GetTransactionsCommand );
When you are dispatching those events in your init() and insertTransactions() functioons make sure that you are dispatching different type of events.
If that is ok then what is happening? Any exceptions? is it going to execute method in the command class?