-
24 Nov 2011 1:55 AM #1
Unanswered: scrollEvent not triggered
Unanswered: scrollEvent not triggered
Hi i am quite new to using gwt ext and having a tough time adding a scrolllistner to a layout container.
what i want to do is get the scroll positions on the scrollevent and use them for further calculations.
But i am not even able to get it triggered.
Here is the dummy code:
public class Workflow extends LayoutContainer implements Entrypoint {
.................
.........
.......
public void onRender(........
.........
setLayout(new FitLayout())
this.setScrollMode(Scroll.Auto);
this.addScrollListener(new ScrollListener () { @Override
public void widgetScrolled(ComponentEvent ce){
Window.alert("Scrolled");
}
});
}...
ideally this should give an alert box when i scroll ... That does not happen!!
-
3 Jan 2012 2:56 AM #2
See example:
Code:ContentPanel c1 = new ContentPanel(); c1.setHeading("Panel 1"); c1.setSize(200, 200); c1.setScrollMode(Scroll.AUTO); c1.addScrollListener(new ScrollListener() { public void widgetScrolled(ComponentEvent ce) { Window.alert("Scrolled"); } }); ContentPanel c2 = new ContentPanel(); c2.setHeading("Panel 2"); c2.setSize(300, 300); c1.add(c2); RootPanel.get().add(c1);
-
3 Jan 2012 2:58 AM #3
In the original post you are using a fitlayout. A FitLayout will never show scrollbars and so also will never fire the scrollevent.


Reply With Quote