Overriding Event Handlers

Unlike methods, event handler cannot be overridden. However, you can use this trick to achieve a similar result.

If you suspect people might want to change the behavior of an event handler in your custom class, don’t put code under the event handler. Instead, use the method attribute of the handler tag to reference a method:

<handler name="oninit" method="handleInit">

People who want to change oninit can then override handleInit to change the behavior of oninit.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset