Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-2455 in 3.0.3.
  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    4
    Vote Rating
    0
    student67 is on a distinguished road

      0  

    Default PagingToolBar buttons not responsive after onBeforeLoad setCancelled

    PagingToolBar buttons not responsive after onBeforeLoad setCancelled


    I've created a Grid with a PagingToolBar. Everything is configured to use a PagingLoader to load data remotely from the server.
    In my special case I have to check whether it is acceptable to jump to another page or not.
    Therefore I registered a LoadHandler at the PagingLoader to catch the event onBeforeLoad and cancel it if necessary.


    Code:
    pagingLoader.addLoaderHandler(new LoaderHandler() {
        @Override
        public void onBeforeLoad(BeforeLoadEvent<FilterPagingLoadConfig> event) {
            boolean decision = Window.confirm("Cancel loading?");
            event.setCancelled(decision);
        }
    }

    After having reset the LoadMask everything seems to be fine except that the PagingToolBar Buttons are not responsive anymore. All clicks are simply ignored.


    After having done some research in the PagingToolBar class I've found out that the loading flag is not properly reset when the event was cancelled. This flag is checked each time a button is clicked and as not reset when the load event was cancelled all button clicks are ignored.
    As this flag cannot be set outside of the PagingToolBar class there is no way to fix this directly.


    So this must be fixed inside the PagingToolBar class itself:


    Code:
      private LoaderHandler<PagingLoadConfig, ?> handler = new LoaderHandler<PagingLoadConfig, PagingLoadResult<?>>() {
    
    
        @Override
        public void onBeforeLoad(final BeforeLoadEvent<PagingLoadConfig> event) {
          loading = true;
          savedEnableState = isEnabled();
          setEnabled(false);
          refresh.setIcon(appearance.loading());
          Scheduler.get().scheduleDeferred(new ScheduledCommand() {
    
    
            @Override
            public void execute() {
              if (event.isCancelled()) {
                refresh.setIcon(appearance.refresh());
                setEnabled(savedEnableState);
                loading = false;  // <-- THIS STATEMENT HAS TO BE ADDED
              }
            }
          });
        }
    
    
        @Override
        public void onLoad(LoadEvent<PagingLoadConfig, PagingLoadResult<?>> event) {
          refresh.setIcon(appearance.refresh());
          setEnabled(savedEnableState);
          PagingToolBar.this.onLoad(event);
          loading = false;
        }
    
    
        @Override
        public void onLoadException(LoadExceptionEvent<PagingLoadConfig> event) {
          refresh.setIcon(appearance.refresh());
          setEnabled(savedEnableState);
          loading = false;
        }
      };

  2. #2
    Sencha User
    Join Date
    Jun 2013
    Location
    Berkeley CA
    Posts
    9
    Vote Rating
    0
    Stevko (UCB) is on a distinguished road

      0  

    Default for the record - this fix is incorporated in gxt-3.0.4.jar

    for the record - this fix is incorporated in gxt-3.0.4.jar


    While research a similar symptom, I've seen this code change incorporated in v 3.0.4 (if not earlier)

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,640
    Vote Rating
    80
    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


    Thanks Stevko, I'm marking this as fixed and linking it to the existing issue where this was resolved (EXTGWT-2455, fixed in 3.0.3).

Thread Participants: 2

Tags for this Thread

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