1.

Explain Event handling in GWT.

Answer»

GWT provides a event handler model similar to Java AWT or SWING User Interface frameworks.

A listener interface defines one or more methods that the widget calls to announce an event. GWT provides a list of interfaces corresponding to various possible events.

A class wishing to receive events of a particular type implements the associated handler interface and then passes a reference to itself to the widget to subscribe to a set of events.

For example, the Button class publishes click events so you will have to write a class to implement ClickHandler to handle click event.

All GWT event handlers have been extended from EventHandler interface and each handler has only a single method with a single argument. This argument is always an object of associated event type. Each event object have a number of methods to manipulate the passed event object.



Discussion

No Comment Found