|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- public interface IDataProvider<T>
Interface used to provide data to data views. Example:
class UsersProvider implements IDataProvider { public Iterator iterator(int first, int count) { ((MyApplication)Application.get()).getUserDao().iterator(first, count); } public int size() { ((MyApplication)Application.get()).getUserDao().getCount(); } public IModel model(Object object) { return new DetachableUserModel((User)object); } }You can use the
IDetachable.detach()
method for cleaning up your IDataProvider instance.
So that you can do one query that returns both the size and the values if your dataset is small
enough the be able to do that.
IDetachable
,
DataViewBase
,
DataView
,
GridView
Method Summary | |
---|---|
Iterator<? extends T> |
iterator(long first,
long count)
Gets an iterator for the subset of total data |
IModel<T> |
model(T object)
Callback used by the consumer of this data provider to wrap objects retrieved from iterator(long, long) with a model (usually a detachable one). |
long |
size()
Gets total number of items in the collection represented by the DataProvider |
Methods inherited from interface org.apache.wicket.model.IDetachable |
---|
detach |
Method Detail |
---|
Iterator<? extends T> iterator(long first, long count)
first
- first row of datacount
- minimum number of elements to retrieve
long size()
IModel<T> model(T object)
iterator(long, long)
with a model (usually a detachable one).
object
- the object that needs to be wrapped
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |