|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDataProvider
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 | |
---|---|
java.util.Iterator |
iterator(int first,
int count)
Gets an iterator for the subset of total data |
IModel |
model(java.lang.Object object)
Callback used by the consumer of this data provider to wrap objects retrieved from iterator(int, int) with a model (usually a detachable one). |
int |
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 |
---|
java.util.Iterator iterator(int first, int count)
first
- first row of datacount
- minimum number of elements to retrieve
int size()
IModel model(java.lang.Object object)
iterator(int, int)
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 |