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;