Custom Events + Robotlegs + dispatch + Overriding the clone() method

Let me preface this by saying, this approach is certainly not the final say. Any tutorials, demos or information shared on my site should be taken for what they are worth. I love feedback, so feel free to leave a comment below.

[Update: As Amy mentioned in the comments, this is not specific to the Robotlegs framework.]

I have recently been tinkering with the new Robotlegs framework and wanted to share a quick gotcha. It’s really not a gotcha, and really more something I forgot to do. Click here to see the post that helped jog my memory on this one. Hope this will come in handy for someone.

View Demo | View Source

If you can’t read the white print on the demo it says:

This demo serves to explain the need for overriding the clone() method on custom events.

Notice that no output is generated when a user clicks the CustomEventOne button.

When a user clicks CustomEventTwo, the output is generated. This is because the MainMediator must re-dispatch the custom event, and so the developer must remember to Override the clone() method.

Right-Click to View Source, then look in the com.diomampo.rlcustomeventdemo.events package at the differences between both events.