Flex - Mate framework - dispatching events -


I have recently changed mats as the framework for Flex. Although there are some issues going on, I want to know how to transmit the events of classes generated through the method invobar tag.

  & lt; ResultHandlers & gt; & Lt; Method invocor generator = "{login sign}" method = "setcant user" argument = "{[resultObject]}" />  

And in class I would like an event dispatch

  public function setCurrentUser. (CalUser: Object): void {if (calUser! = Null) as {Model.instance.currentUser = calUser CalUser; LoadOnlineCalendar (Model.instance.currentUser); }} Public function loadOnlineCalendars (calUser: CalUser): void {(var i: int = 0; i & LT; calUser.calConnectors.length; i ++) {// logic here dispatchEvent (new CalConnectorEvent (CalConnector, CalConnectorEvent Form calUser.calConnectors. LOAD_ONLINE_CALENDAR_EVENT, true)); }}  

The problem is that I can not be able to capture the event in the event map or even in the application root.

If someone has any experience with a friend, I appreciate some indicators. Maybe I'm doing all this wrong I just want to get results from the server - look at the results and contact the server again on the basis of the result. Should be very simple.

Event Map:

  & lt; Results Handlers & gt; & Lt; Method invocor generator = "{login sign}" method = "setcant user" argument = "{[resultObject]}" /> & Lt; ServiceResponseAnnouncer Type = "Result" /> & Lt; / ResultHandlers & gt; & Lt; FaultHandlers & gt; & Lt; ServiceResponseAnnouncer Type = "Defect" /> & Lt; / FaultHandlers & gt; & Lt; / RemoteObjectInvoker & gt;  

By the way This is usually done in the object inventor needle of the event map:

  & lt; MethodInvoker generator = "{MyClass}" method = "someMethod" arguments = "{[a, b]}"> gt; & Lt; Property Dispatcher = "{scope.dispatcher}" /> & Lt; / MethodInvoker & gt; The  

inner property tag is being created on the object by the property MethodInvoker , and the property is guaranteed to be set before the method is applied.

The class is obviously supposed to have a public property called dispatcher (or the name you like) to work on it. Events that you want to hear in event map call dispatcher.dispatchEvent (...) , to dispatch.

If the object made by MethodInvoker will be used more than once, if it is a manager, said the common parlance it ObjectBuilder Use To create, this is an event handler block which is FlexEvent.INITIALIZE :

   & lt; / EventHandlers & gt;  

In this example, Event Despatcher is injected as Constructor Logic, but you can only use Properties tags for MethodInvoker Can do with


Comments