Package org.zkoss.zul.impl
Interface DataLoader
- All Known Implementing Classes:
GridDataLoader,ListboxDataLoader
public interface DataLoader
DataLoader is used with
Grid, Listbox
to handle data loading from model to server and then to client side.- Since:
- 5.0.0
- Author:
- henrichen
-
Method Summary
Modifier and TypeMethodDescriptionvoidHandle event when GroupsDataEvent is fired from owner component.voiddoListDataChange(ListDataEvent event) Handle event when ListDataEvent is fired from owner component.intgetLimit()Returns the required visible limit size of the current loaded data chunk to be shown on the screen.intReturns the requested visible offset of the current loaded data chunk.org.zkoss.zk.ui.ComponentgetOwner()Returns the associated owner component of this DataLoader.Return the renderer to do rendering.intReturns the total size of the data.voidinit(org.zkoss.zk.ui.Component owner, int offset, int limit) Callback from the owner component and give a chance to initialize things.voidreset()Callback from the owner component and give a chance to reset things.voidsetLoadAll(boolean b) Sets whether to always load all items from ListModel.voidsyncModel(int offset, int limit) Synchronizes the owner component to be consistent with the specified model.voidUsed to update some extra control information to the client.
-
Method Details
-
init
void init(org.zkoss.zk.ui.Component owner, int offset, int limit) Callback from the owner component and give a chance to initialize things.- Parameters:
owner- the owner component of this DataLoader.
-
reset
void reset()Callback from the owner component and give a chance to reset things. -
getOwner
org.zkoss.zk.ui.Component getOwner()Returns the associated owner component of this DataLoader. -
getOffset
int getOffset()Returns the requested visible offset of the current loaded data chunk.- Returns:
- the requested visible offset of the current loaded data chunk.
-
getLimit
int getLimit()Returns the required visible limit size of the current loaded data chunk to be shown on the screen.- Returns:
- the required visible limit size of the current loaded data chunk to be shown on the screen.
-
doListDataChange
Handle event when ListDataEvent is fired from owner component. -
doGroupsDataChange
Handle event when GroupsDataEvent is fired from owner component.- Parameters:
event- the corresponding GroupsDataEvent- Since:
- 8.0.4
-
getTotalSize
int getTotalSize()Returns the total size of the data.- Returns:
- the total size of the data.
-
syncModel
void syncModel(int offset, int limit) Synchronizes the owner component to be consistent with the specified model.- Parameters:
offset- the starting index of the range to do data synchronize.limit- the size of the range to do data synchronize. -1 means the current range.
-
updateModelInfo
void updateModelInfo()Used to update some extra control information to the client. -
getRealRenderer
Object getRealRenderer()Return the renderer to do rendering. -
setLoadAll
void setLoadAll(boolean b) Sets whether to always load all items from ListModel.
-