Selecting
Select Event
The Select event is an application event fired by GXT components. An "application" event is one fired by the library, and not the browser. Contrast this to the GWT Event.ONCLICK which is fired by the browser when an element is clicked. The GXT Events class defines all the events fired by GXT components. The Events class also provides some shortcuts to the GWT events as a convenience. Any GXT event that is a browser event is prefixed with "On", for example, Events.OnClick is equal to the GWT Event.ONCLICK. The Select event is fired when a component is selected. For example, Button and TextToolItem fire the Select event. Here is an example of listening to a Select event on a Button:
SelectionListener
Events.Select is used with the "untyped" API which uses the Listener for all events. Many GXT components provide "typed" listeners. Typed listeners are specific to the component and the event. The SelectionListener provides the same access to the Select event using a "typed" listener.
You may be wondering what the difference is between the "untyped" and "typed" API. For the Select event, there is not much difference. However, the "typed" listeners can support more than one raw event. For example, WindowListener looks like this:
You could listen to the same events using the "untyped" API but you would need to add listeners for many events:
SelectionChange
The SelectionChange event fires when a component's "selection" changes. A "selection" comprises zero or more selected items. For example, the "selection" of a table, would be all TableItems that are currently selected. The event is fired any time the selection is changed. The selected items are not passed with the event. You must get the current selection from the selection source itself.
SelectionChangedListener
The SelectionChangedListener is a "typed" listener that passes the domain objects that are represented by the selection. SelectionChangedListeners can receive events generated by any object that implements the SelectionProvider interface. Within GXT, binders are selection providers.