PDA

View Full Version : Stopping the SelectionEvent



tz_Dev
3 Apr 2014, 1:03 PM
Hi ,
I have the following code below, how do I stop the event from propagating , i.e. event.Stop() or event.kill()


getGrid().getSelectionModel().addSelectionHandler( new SelectionHandler<Client> () {

@Override
public void onSelection(SelectionEvent<Client> event) {
Client client=event.getSelectedItem();
//event.stop
sendToFav(client);


}
} );

feelinforyou
3 Apr 2014, 10:45 PM
I don't know what you want to do exactly. But if you want to cancel the selection you can do something like this:



grid.getSelectionModel().addBeforeSelectionHandler(new BeforeSelectionHandler<DbTestItemCombination>() {
@Override
public void onBeforeSelection(BeforeSelectionEvent<DbTestItemCombination> event) {
final DbTestItemCombination combination = event.getItem();
event.cancel();
}
});


You can get the item before it is selected and use it for your method.