@ -50,7 +50,6 @@ public class GeonaRecordsPaginatedView {
private MyCustomDataProvider < DocumentDV > dataProvider = new MyCustomDataProvider < DocumentDV > ( ) ;
protected Widget orginalLoadingIndicator = null ;
private LoaderIcon loadingPanel = new LoaderIcon ( "Loading data..." ) ;
// private int serverStartIndex;
private HandlerManager eventBus ;
private SearchingFilter currentSearchingFilter ;
private String profileID ;
@ -74,7 +73,6 @@ public class GeonaRecordsPaginatedView {
orginalLoadingIndicator = itemsTable . getCellTable ( ) . getLoadingIndicator ( ) ;
initPagination ( ITEMS_PER_PAGE ) ;
// loadNewPage(ITEM_START_INDEX, ITEMS_PER_PAGE, false);
loadItemsForType ( profileID ) ;
}
@ -117,31 +115,27 @@ public class GeonaRecordsPaginatedView {
/ * *
* Load new page .
*
* @param profileID the profile ID
* @param startIdx the start idx
* @param limit the limit
* @param resetStore the reset store
* @param currentS ortFilter the current sort filter
* @param invalidCache the invalid cache
* @param profileID the profile ID
* @param startIdx the start idx
* @param limit the limit
* @param resetStore the reset store
* @param currentS earchFilter the current search filter
* @param invalidCache the invalid cache
* /
private void loadNewPage ( String profileID , final int startIdx , final int limit , final boolean resetStore ,
final SearchingFilter currentSortFilter , final boolean invalidCache ) {
// initFirstRangeChanged = resetStore;
final SearchingFilter currentSearchFilter , final boolean invalidCache ) {
GWT . log ( "loadNewPage with parameters [startIdx: " + startIdx + ", limit: " + limit + ", resetStore:"
+ resetStore + "]" ) ;
// showLoading(true);
int newStartIndex = startIdx ;
if ( resetStore ) {
GWT . log ( "Cleaning all data..." ) ;
newStartIndex = 0 ;
// serverStartIndex = 0;
GWT . log ( "Store reset performed start index is: " + newStartIndex ) ;
getTableDataProvider ( ) . updateRowCount ( ITEMS_PER_PAGE , false ) ;
}
loadProjects ( profileID , newStartIndex , limit , currentS ort Filter, invalidCache ) ;
loadProjects ( profileID , newStartIndex , limit , currentS earch Filter, invalidCache ) ;
}
/ * *
@ -221,17 +215,17 @@ public class GeonaRecordsPaginatedView {
* @param theProfileID the the profile ID
* @param newStartIndex the new start index
* @param limit the limit
* @param s ortFilter the sort filter
* @param s earchFilter the search filter
* @param invalidCache the invalid cache
* /
private < T > void loadProjects ( String theProfileID , int newStartIndex , int limit , SearchingFilter s ort Filter,
private < T > void loadProjects ( String theProfileID , int newStartIndex , int limit , SearchingFilter s earch Filter,
boolean invalidCache ) {
showLoading ( true ) ;
GWT . log ( "calling loadItemsForStatus with parameters [theProfileID: " + theProfileID + ", startIndex: "
+ newStartIndex + ", limit: " + limit + ", s ortFilter: " + sort Filter + "]" ) ;
GeoPortalDataEntryApp . geoportalDataEntryService . getListProjects ( theProfileID , newStartIndex , limit , sortFilter ,
invalidCache, new AsyncCallback < ResultSetPaginatedData > ( ) {
+ newStartIndex + ", limit: " + limit + ", s earchFilter: " + search Filter + "]" ) ;
GeoPortalDataEntryApp . geoportalDataEntryService . getListProjects ( theProfileID , newStartIndex , limit ,
searchFilter, invalidCache, new AsyncCallback < ResultSetPaginatedData > ( ) {
@Override
public void onFailure ( Throwable caught ) {
@ -265,11 +259,16 @@ public class GeonaRecordsPaginatedView {
itemsTable . getSelectionModel ( ) . setSelected ( item , select ) ;
}
}
/ * *
* Removes the column .
*
* @param columnName the column name
* /
public void removeColumn ( DEFAULT_DISPLAYING_COLUMN_NAME columnName ) {
try {
itemsTable . removeColumn ( columnName ) ;
} catch ( Exception e ) {
} catch ( Exception e ) {
// TODO: handle exception
}
}
@ -283,9 +282,6 @@ public class GeonaRecordsPaginatedView {
return itemsTable . getSelectedItems ( ) ;
}
// int latestRangeStart = -1;
// int latestRangeLenght = -1;
/ * *
* A custom { @link AsyncDataProvider } .
*
@ -310,15 +306,6 @@ public class GeonaRecordsPaginatedView {
int start = range . getStart ( ) ;
int length = range . getLength ( ) ;
// if(latestRangeStart!=start || latestRangeLenght!=length) {
// GWT.log("ranges really changed");
// latestRangeStart = start;
// latestRangeLenght = length;
// }else {
// GWT.log("ranges DO NOT changed");
// return;
// }
if ( initClassFirstRangeChanged ) {
GWT . log ( "initClassFirstRangeChanged is true.. returning" ) ;
initClassFirstRangeChanged = false ;
@ -326,8 +313,6 @@ public class GeonaRecordsPaginatedView {
}
GWT . log ( "Range changed: " + start + " " + length + " visible count: " + display . getVisibleItemCount ( ) ) ;
loadNewPage ( profileID , start , length , false , currentSearchingFilter , false ) ;
// eventBus.fireEvent(new TableRangeViewChangedEvent<T>(start, length));
}
}