1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    1
    Vote Rating
    0
    neha.chowdary is on a distinguished road

      0  

    Question 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!!

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Nov 2010
    Posts
    209
    Vote Rating
    -1
    Answers
    4
    Ersmarker is an unknown quantity at this point

      0  

    Default


    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. #3
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,715
    Vote Rating
    107
    Answers
    60
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    In the original post you are using a fitlayout. A FitLayout will never show scrollbars and so also will never fire the scrollevent.