I ve been having some problems with DataView that always retrieve the old data set. Even though the page has been re-loaded, IDataProvider has never been updated into the current state of the database. Here is how my IDataProvider looks like :
private class MyDataProvider implements IDataProvider<Item> {
private List<Item> list;
private List<Item> getData() {
if(list == null) {
list = projectLogic.getItems();
Collections.reverse(list);
}
return list;
}
@Override
public Iterator<Item> iterator(int first, int count){
return getData().subList(first, first + count).iterator();
}
@Override
public int size(){
return getData().size();
}
@Override
public IModel<Item> model(Item object){
return new DetachableItemModel(object);
}
/**
* Detaches model after use. This is generally used to null out transient references that can be re-attached later.
*/
@Override
public void detach(){
list = null;
}
}
每一(a)项已经将清单定为无效,但为何不影响我在数据概览中的供应商?