blay
27 Dec 2010, 3:53 AM
Hello:
I´ve added a listener like this:
Document.get().addListener(Events.OnKeyPress, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
if (ce.getKeyCode()== KeyCodes.KEY_ENTER)
doWhatheverShouldBeDone();
}
});
So when I press Enter , something happens. That´s right. But I´ve read about sinkEvents and I don´t understand it well. As far as I know, in GXT, it has to be used for components to listen to events that are not supported by default. I don´t know if in this case it´s needed or not...or if I´m wrong in some assumptions I´m doing...
Can anyone explain me briefly when I should use sinkEvent and its porpuse?
Thanks
I´ve added a listener like this:
Document.get().addListener(Events.OnKeyPress, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
if (ce.getKeyCode()== KeyCodes.KEY_ENTER)
doWhatheverShouldBeDone();
}
});
So when I press Enter , something happens. That´s right. But I´ve read about sinkEvents and I don´t understand it well. As far as I know, in GXT, it has to be used for components to listen to events that are not supported by default. I don´t know if in this case it´s needed or not...or if I´m wrong in some assumptions I´m doing...
Can anyone explain me briefly when I should use sinkEvent and its porpuse?
Thanks