Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-2508 in a recent build.
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    134
    Vote Rating
    1
    bluemartini is on a distinguished road

      0  

    Default If active page is greater then number of pages, last page is not displaying.

    If active page is greater then number of pages, last page is not displaying.


    Issue: If active page is greater then number of pages, last page is not displaying.


    Our Analysis:
    When LoadEvent is fired, handler in PaggingToolBar get executed where method onLoad()[find the snippet #2] is called. In method onLoad() if activepage is greater then pages and totalresult is greater then 1, then calling the last() method to show the last page.
    But, due to the condition "is loading"[find the snippet #3] which remains true in method last(), so last page is not loading.

    Actually, rootcause is on BeforeLoadHandler, initializing property loading to true[find the snippet #1]. As per the above before calling method last() the property loading should be initialized to false which is not done.

    Please find the below code snippet in PagingToolBar.java
    #1: private LoaderHandler<PagingLoadConfig, ?> handler = new LoaderHandler<PagingLoadConfig, PagingLoadResult<?>>() {


    @Override
    public void onBeforeLoad(final BeforeLoadEvent<PagingLoadConfig> event) {
    loading = true;
    //Other stuff of code goes here.
    }


    @Override
    public void onLoad(LoadEvent<PagingLoadConfig, PagingLoadResult<?>> event) {
    refresh.setIcon(appearance.refresh());
    setEnabled(savedEnableState);
    PagingToolBar.this.onLoad(event); //#1.1
    loading = false; //#1.2
    }


    @Override
    public void onLoadException(LoadExceptionEvent<PagingLoadConfig> event) {


    }
    };


    #2: protected void onLoad(LoadEvent<PagingLoadConfig, PagingLoadResult<?>> event) {
    config = event.getLoadConfig();
    PagingLoadResult<?> result = event.getLoadResult();
    start = result.getOffset();
    totalLength = result.getTotalLength();
    activePage = (int) Math.ceil((double) (start + pageSize) / pageSize);


    pages = totalLength < pageSize ? 1 : (int) Math.ceil((double) totalLength / pageSize);


    if (activePage > pages && totalLength > 0) {
    last();
    return;
    } else if (activePage > pages) {
    start = 0;
    activePage = 1;
    }

    //Other stuff of code goes here
    }

    #3: /**
    * Moves to the last page.
    */
    public void last() {
    if (!loading) {
    if (totalLength > 0) {
    int extra = totalLength % pageSize;
    int lastStart = extra > 0 ? (totalLength - extra) : totalLength - pageSize;
    doLoadRequest(lastStart, pageSize);
    }
    }
    }
    Thanks.

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This sounds like a bug and i will move this thread to the proper forums. Thanks for reporting

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    134
    Vote Rating
    1
    bluemartini is on a distinguished road

      0  

    Default


    Is there a suggested work around for this ?

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,634
    Vote Rating
    79
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    This issue has been fixed in SVN, and will be in tonight's nightly build as well as the next release.

    There isn't a terribly clean workaround for this. The closest it looks like you could get would be to override onLoad and set loading to false before calling super, but if that method starts a new load to grab the real last page (and sets loading to true again), the code that normally calls it will set loading back to false, making the internal state invalid. This might work, but I have not tested it to be sure.

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar