1. #1
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Answers
    5
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Default Unanswered: PagingComboBox caches the last request

    Unanswered: PagingComboBox caches the last request


    Hello,

    it seems that the PagingComboBox is caching the last known search.

    http://www.sencha.com/examples/#Exam...vancedcombobox

    For example if you type in "test" in the Sencha GXT Explorer Demo and then again, there isn't a new load request.

    I know this can be good for performance reasons but this is a problem, because if the data changes in this time, there won't be the updated (correct) data. There will be only the last known (wrong) data. Is there a way to disable the cache so, that the load request of the RpcProxy always is thrown and gets the new data from the server?

    Code:
    final ListStore<PlayerDto> store = new ListStore<PlayerDto>(props.id());                 
    final ListView<PlayerDto, PlayerDto> view = new ListView<PlayerDto, PlayerDto>(store, new IdentityValueProvider<PlayerDto>());                 
    view.setCell(new AbstractCell<PlayerDto>() {                        
     @Override                         
    public void render(Context context, PlayerDto value, SafeHtmlBuilder sb) {
    sb.append(KickerTemplates.TEMPLATE.renderPlayerPagingComboBox(value));
    }                
    });                 
    
    final ComboBoxCell<PlayerDto> cell = new ComboBoxCell<PlayerDto>(store, props.label(), view);
    final AppComboBox<PlayerDto> cbPlayer = new AppComboBox<PlayerDto>(cell, emptyText);
    
    final RpcProxy<PagingLoadConfig, PagingLoadResult<PlayerDto>> proxy = new RpcProxy<PagingLoadConfig, PagingLoadResult<PlayerDto>>() {                         
    @Override                         
    public void load(PagingLoadConfig loadConfig, AsyncCallback<PagingLoadResult<PlayerDto>> callback) {
    KickerServices.PAGING_SERVICE.getPagedPlayers(cbPlayer.getText(), loadConfig, callback);
    }                 
    };                 
    final PagingLoader<PagingLoadConfig, PagingLoadResult<PlayerDto>> loader = new PagingLoader<PagingLoadConfig, PagingLoadResult<PlayerDto>>(proxy);
    loader.addLoadHandler(new LoadResultListStoreBinding<PagingLoadConfig, PlayerDto, PagingLoadResult<PlayerDto>>(store));  
                    
    cbPlayer.setHideTrigger(true);                 
    cbPlayer.setLoader(loader);                 
    cbPlayer.setPageSize(5);                 
    cbPlayer.setMinChars(2);                 
    return cbPlayer;

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    From within ComboBoxCell.doQuery:
    Code:
    ...
          if (!useQueryCache || !query.equals(lastQuery)) {
    ...
              l.load(getParams(query));
    ...
    I would guess that setting useQueryCache to false would do this. Unfortunatly, there doesn't seem to be a setter for this property. Instead, you can use JSNI to set this from within your own code.

    I'll file an issue to expose this with a getter and setter.

  3. #3
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Answers
    5
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Default


    Thank your very much for this answer. I can see the problem now. I hope, it will be implemented in the next release soon.

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Did you try setting that to false? JSNI will allow you to do this, so you won't have to wait for a fix.

Thread Participants: 1

Tags for this Thread