Note that there are some explanatory texts on larger screens.

plurals
  1. POFlex - Mate framework - dispatching events
    text
    copied!<p>I've recently changed to Mate as a framework for flex. However am running into a few issues. I want to know how to dispatch events from classes generated via the methodInvoker tag.</p> <pre><code>&lt;resultHandlers&gt; &lt;MethodInvoker generator="{LoginSuccess}" method="setCurrentUser" arguments="{[resultObject]}"/&gt; </code></pre> <p></p> <p>Then in the class I'd like to dispatch an event.</p> <pre><code>public function setCurrentUser(calUser:Object):void{ if(calUser != null){ Model.instance.currentUser = calUser as CalUser; loadOnlineCalendars(Model.instance.currentUser); } } public function loadOnlineCalendars(calUser:CalUser):void{ for(var i:int = 0 ; i&lt;calUser.calConnectors.length; i++){//logic here dispatchEvent(new CalConnectorEvent(calUser.calConnectors as CalConnector,CalConnectorEvent.LOAD_ONLINE_CALENDAR_EVENT,true)); } } </code></pre> <p>The problem is I can't seem to be able to catch the event in the eventMap or even in the application root.</p> <p>If anyone has any experience with Mate, I'd appreciate some pointers. Perhaps I'm doing this all wrong. I just want to get a result from the server - look at the result and depending on the result contact the server again. Should be quite simple.</p> <p>Event Map: </p> <pre><code> &lt;resultHandlers&gt; &lt;MethodInvoker generator="{LoginSuccess}" method="setCurrentUser" arguments="{[resultObject]}"/&gt; &lt;ServiceResponseAnnouncer type="result"/&gt; &lt;/resultHandlers&gt; &lt;faultHandlers&gt; &lt;ServiceResponseAnnouncer type="fault"/&gt; &lt;/faultHandlers&gt; &lt;/RemoteObjectInvoker&gt; </code></pre> <p></p> <p> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload