GWT OnScroll event does not fire

I have a small application that wraps a TextArea inside a ScrollPanel .

When I create an instance of ScrollPanel and attach a ScrollEventHandler WITHIN OnModuleLoad() - the OnScroll event fires properly.

However, when I create a separate Composite class for the ScrollPanel wrapping TextArea , attach a handler to it - OnScroll DOES NOT start. I see a composite widget on the screen, and compilation errors or runtime errors are not displayed, but still - nothing happens when I scroll.

Any ideas?

+4
source share
1 answer

Have you added sinkEvents(Event.ONSCROLL) ?

The Composite widget is a somewhat weird compilation that claims to be an internal widget like itself. Try creating your own widget and use setElement(DOM.createDiv()) and your own widget. This may help if sinkEvent(int) code is not working.

0
source

Source: https://habr.com/ru/post/1335067/


All Articles