tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/116-mediator-doesnt-work-when-dispatching-existing-eventRobotlegs: Discussion 2013-04-28T10:01:12Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/20734992010-06-25T06:52:51Z2010-06-25T06:52:54ZMediator doesn't work when dispatching existing event<div><p>OK, the problem is resolved by adding the following clone() in
MyEvent.</p>
<pre>
<code>public class MyEvent extends Event
{
...
override public function clone():Event
{
return new MyEvent(this.type);
}
}</code>
</pre>
<p>So I think it is a must for Robotlegs application to provide a
clone() in every custom event?</p></div>Heztag:robotlegs.tenderapp.com,2009-10-18:Comment/20734992010-06-25T07:17:13Z2010-06-25T07:17:13ZMediator doesn't work when dispatching existing event<div><p>It is best practice with ANY custom events, irrespective of
framework, to override the clone() method. Events cannot be
redispatched or bubbled without doing so.</p></div>Joel Hooks