net.codescore.ui.components.list
Class AbstractDropDown<L,T>
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Window
net.codescore.ui.components.list.ZKObjectList<L>
net.codescore.ui.components.list.AbstractDropDown<L,T>
- Type Parameters:
L - The list item typeT - The target type
- All Implemented Interfaces:
- Serializable, Cloneable, Component, IdSpace, ComponentCtrl
- Direct Known Subclasses:
- CompetitionDD, PersonDD, SchoolDD, TeamDD
public abstract class AbstractDropDown<L,T>
- extends ZKObjectList<L>
This component will display an HTML select list and automaticaly set the
target's value when an item is selected.
One example is the TeamDD, which is typed as < Team,
TeamTarget >, so, when the onSelect() method is called, the
TeamTarget.setTeam(Team) method is called, using the currently
selected team as the method argument.
- Author:
- Adam Cornett
- See Also:
- Serialized Form
|
Field Summary |
private org.apache.commons.logging.Log |
log
|
protected T |
targetObject
|
|
Constructor Summary |
AbstractDropDown(T target)
Creates a drop down (HTML select element) using a specified list of
items, and sets the target object when an object is chosen from the list. |
| Methods inherited from class net.codescore.ui.components.list.ZKObjectList |
addListForward, getCallbackWin, getListSelected, getWindowTitle, initListModel, initListModel, initRenderer, reLoadList, removeObject, setCallbackWin, setList, setListMold, setListWidth, setSelected, setWindowTitle, sort |
| 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 org.zkoss.zk.ui.AbstractComponent |
addAnnotation, addAnnotation, addEventHandler, addEventListener, addForward, addForward, addMoved, addSharedAnnotationMap, addSharedEventHandlerMap, appendAsapAttr, appendAsapAttr, appendChild, applyProperties, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getCommand, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellowIfAny, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getMoldURI, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, invalidate, isAsapRequired, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onDrawNewChild, onPageAttached, onPageDetached, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPageBefore, setVariable, smartUpdate, smartUpdate, smartUpdate, smartUpdateDeferred, smartUpdateValues, toString, unsetVariable |
log
private org.apache.commons.logging.Log log
targetObject
protected final T targetObject
AbstractDropDown
public AbstractDropDown(T target)
- Creates a drop down (HTML select element) using a specified list of
items, and sets the target object when an object is chosen from the list.
- Parameters:
target - The target object for the list
getQueryName
public abstract String getQueryName()
- Returns the
NamedQuery name for this list.
- Returns:
getRenderer
public abstract AbstractRenderer<L> getRenderer()
- Returns:
- The renderer to be used for the list.
onSelect
public abstract void onSelect()
- The action to be performed when the and item is selected from the list.
- Overrides:
onSelect in class ZKObjectList<L>
setSelected
public abstract void setSelected()
getList
protected List<L> getList()
- Performs the
NamedQuery specified by the getQuery()
method and returns the list.
- Returns:
- A
List of type that is to be displayed.
getQuery
protected Query getQuery()
- Creates a new
NamedQuery from the getQueryName() method
- Returns:
- A Query that will generate a list of items to be displayed in
the list.
reloadList
protected void reloadList()
- This method re-performs the query and re-initializes the list model and
renderer
Copyright 2008 © Adam Cornett, Andrew Conner All Rights Reserved.