|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Window
net.codescore.ui.components.list.ZKObjectList<T>
T - The object type for the listpublic class ZKObjectList<T>
This class provides a strong framework for quickly generating a list of
objects. This list can generate a table style list, or a select element.
For creating an HTML select control, use the AbstractDropDown class.
This class relies on an external renderer class to render each cell in the
table, and must be initialized correctly, please see an example
implementation, such as the DynamicScoreBoard which uses this class to
generate the score board.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zul.Window |
|---|
Window.ExtraCtrl |
| Field Summary | |
|---|---|
protected Window |
callBackWin
This window is passed to the onSelect event for use by the
renderer's doAction |
protected List<T> |
data
|
private Listhead |
head
|
protected List<T> |
initData
|
protected Listbox |
list
|
private ListModelList |
model
|
protected AbstractRenderer<T> |
renderer
This is the renderer used to render the list, it also handles sorting and onSelect events |
private static long |
serialVersionUID
|
private String |
windowTitle
|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
ZKObjectList()
Default constructor |
|
ZKObjectList(boolean noForward)
|
|
ZKObjectList(List<T> l,
AbstractRenderer<T> ren)
|
|
ZKObjectList(String title)
|
|
ZKObjectList(String title,
boolean noForward)
|
|
ZKObjectList(String title,
List<T> l,
AbstractRenderer<T> ren)
|
|
| Method Summary | |
|---|---|
void |
addListForward(String orgEvent,
Component target,
String targetEvent)
Adds a forward for the list's onSelect event |
Window |
getCallbackWin()
|
T |
getListSelected()
Returns the selected item in the list. |
String |
getWindowTitle()
|
void |
initListModel()
initalizes the list model |
void |
initListModel(List<T> l)
initalizes the list model |
void |
initRenderer(AbstractRenderer<T> r)
Initalizes the item renderer |
void |
onSelect()
|
void |
reLoadList(List<T> l)
reloads the list data |
void |
removeObject(DataObject l)
removes and object from the list and the database |
void |
setCallbackWin(Window oah)
|
protected void |
setList(List<T> l)
Sets the data to be rendered |
void |
setListMold(String mold)
Sets the list's 'mold' attribute |
void |
setListWidth(String width)
|
void |
setSelected(T obj)
|
void |
setWindowTitle(String windowTitle)
|
void |
sort(int colNum)
|
| Methods inherited from class org.zkoss.zul.Window |
|---|
clone, doEmbedded, doHighlighted, doModal, doOverlapped, doPopup, getBorder, getCaption, getContentSclass, getContentStyle, getCtrlKeys, getDefaultActionOnShow, getMode, getOuterAttrs, getPosition, getRealStyle, getSclass, getTitle, getTitleSclass, inEmbedded, inHighlighted, inModal, inOverlapped, inPopup, insertBefore, isClosable, isSizable, newExtraCtrl, onChildRemoved, onClose, onModal, setBorder, setClosable, setContentSclass, setContentStyle, setCtrlKeys, setDefaultActionOnShow, setDraggable, setMode, setMode, setPage, setParent, setPosition, setSclass, setSizable, setTitle, setVisible |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getRealSclass, getRealStyleFlags, getStyle, getTooltiptext, getTop, getWidth, getZIndex, setClass, setDroppable, setFocus, setHeight, setLeft, setStyle, setTooltiptext, setTop, setWidth, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zk.ui.IdSpace |
|---|
getFellow, getFellowIfAny |
| Field Detail |
|---|
private static final long serialVersionUID
private Listhead head
private ListModelList model
private String windowTitle
protected Window callBackWin
onSelect event for use by the
renderer's doActionmethod.
protected List<T> data
protected List<T> initData
protected Listbox list
protected AbstractRenderer<T> renderer
| Constructor Detail |
|---|
public ZKObjectList()
public ZKObjectList(boolean noForward)
noForward - If true, the constructor will not set a handler for the list's
onSelect event.
public ZKObjectList(List<T> l,
AbstractRenderer<T> ren)
l - the list of objects to be renderedren - the renderer the list should usepublic ZKObjectList(String title)
title - This window's title Window.setTitle(String)
public ZKObjectList(String title,
boolean noForward)
title - This window's title Window.setTitle(String)noForward - If true, the constructor will not set a handler for the list's
onSelect event.
public ZKObjectList(String title,
List<T> l,
AbstractRenderer<T> ren)
title - This window's title Window.setTitle(String)l - the list of objects to be renderedren - the renderer the list should use| Method Detail |
|---|
public void addListForward(String orgEvent,
Component target,
String targetEvent)
onSelect event
orgEvent - target - targetEvent - Component.addForward(String, Component, String)public Window getCallbackWin()
public T getListSelected()
public String getWindowTitle()
public final void initListModel()
public final void initListModel(List<T> l)
l - the list to usesetList(List)public final void initRenderer(AbstractRenderer<T> r)
r - the renderer to be used by the listpublic void onSelect()
public void reLoadList(List<T> l)
l - the new data to be renderedpublic final void removeObject(DataObject l)
l - object to be removedpublic void setCallbackWin(Window oah)
public void setListMold(String mold)
mold - Component.setMold(String)public void setListWidth(String width)
public void setSelected(T obj)
public void setWindowTitle(String windowTitle)
public void sort(int colNum)
protected void setList(List<T> l)
l -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||