tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/86-convenience-method-for-re-dispatching-view-events-in-a-mediatorRobotlegs: Discussion 2018-10-18T16:35:09Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/11717662010-03-08T12:55:38Z2010-03-08T12:55:38ZConvenience Method for Re-dispatching View Events in a Mediator?<div><p>Have you tried this:</p>
<pre>
eventMap.mapListener(myView, ViewEvent.FOO, dispatch, ViewEvent);
</pre></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/11717662010-03-08T12:57:03Z2010-03-08T12:59:28ZConvenience Method for Re-dispatching View Events in a Mediator?<div><p>That functionality is already included - it's just that it's
too<br>
obvious to see. I know that it took a hint in the support area for
me<br>
to see it, at least.</p>
<p>What you're doing in your redispatchEvent method is exactly
what<br>
dispatch already does for you: It (re-)dispatches an event to
the<br>
Robotlegs event bus. Thus, you can just use dispatch as the
event<br>
handler and be done with it:</p>
<pre>
<code>override public function onRegister() : void {
eventMap.mapListener(myView, ViewEvent.FOO, dispatch, ViewEvent);
}</code>
</pre>
<p>In Robotlegs 1.1, that will be simplified to</p>
<pre>
<code>override public function onRegister() : void {
addViewListener(ViewEvent.FOO, dispatch, ViewEvent);
}</code>
</pre></div>Till Schneidereittag:robotlegs.tenderapp.com,2009-10-18:Comment/11717662010-03-08T12:58:00Z2010-03-08T13:11:04ZConvenience Method for Re-dispatching View Events in a Mediator?<div><p>Well don't I feel foolish! I've just updated the Best Practices
document to make mention of this as that's the first place I looked
for the answer.</p>
<p>Thanks guys :)</p></div>Jonny Reeves