What is the purpose of the enableEvents() method? When you register a listener, enableEvents() is called. So you don’t have to do this separately. However, there could be situations where you need an object to handle its own events. This can also be achieved by using a listener though. An example of the usage of this method would be an event of closing the window where you want to prompt the user to save the data when he clicks on the ‘X’ icon.
|