Upgrade SmartGWT from 1.3 to 2.5
GWt 2.0.4, GWT-SL0.1.5
PagedDataSource extends GwtDataSource extends DataSource
ContentProviderDataSource extends PagedDataSource
By put the break point, I found the onSuccess method was called multiple times. After first 5 rows were shown, the ContentGrid is refreshed itself and the second set of same data attached to the ContentGrid.
I use the contentGrid.invalidateCache() before the call reaches the method executeFetch from the PagedDataSource. The invalidateCache() only reaches once.
Please help.
Thanks a lot.
James.
GWt 2.0.4, GWT-SL0.1.5
PagedDataSource extends GwtDataSource extends DataSource
Code:
@Override protected void executeFetch(final String requestId, final DSRequest request, final DSResponse response) { int pageNumber = 0; if (pagingCanvas != null) pageNumber = pagingCanvas.getCurrentPage(); String sortBy = request.getAttribute("sortBy"); if (!isSortByMatches(sortBy, lastSortBy)) { pageNumber = 1; } lastSortBy = sortBy; executePagedFetch(createSearchVo(sortBy, pageNumber), requestId, request, response); }
Code:
@Override public void executePagedFetch(SearchVo searchVo, final String requestId, final DSRequest request, final DSResponse response) { AsyncCallback<PagingVO<ContentVO>> callBack = new AsyncCallback<PagingVO<ContentVO>>() { @Override public void onFailure(Throwable exception) { myApp.closeWaitDialog(); setPagedFetchFailed(requestId, request, response, exception); MyGwtExceptionHandler.alertException(this.getClass(), exception); } @Override public void onSuccess(PagingVO<ContentVO> result) { myApp.closeWaitDialog(); setPagedFetchResults(requestId, request, response, result); } }; myApp.openWaitDialog(); }
I use the contentGrid.invalidateCache() before the call reaches the method executeFetch from the PagedDataSource. The invalidateCache() only reaches once.
Please help.
Thanks a lot.
James.
Comment