E
- Element type in modelpublic class Cascader<E> extends HtmlBasedComponent implements Disable
Available in ZK EE.
Default getZclass()
: z-cascader.
HtmlBasedComponent.ExtraCtrl
AbstractComponent.Children
_zclass
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
Constructor and Description |
---|
Cascader() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clones the component.
|
Converter<java.util.Collection<E>,java.lang.String> |
getItemConverter()
Returns the converter that generates the label text shown in the cascader
from selected items, or null to use the default implementation.
|
ItemRenderer<E> |
getItemRenderer()
Returns the renderer to render each item, or null if the default
renderer is used.
|
TreeModel<E> |
getModel()
Returns the model associated with this cascader, or null if this cascader
is not associated with any tree data model.
|
java.lang.String |
getPlaceholder()
Returns the placeholder text.
|
E |
getSelectedItem()
Returns the selected item.
|
java.util.Set<E> |
getSelectedItems()
Returns all selected items.
|
java.lang.String |
getZclass()
Returns the ZK Cascading Style class(es) for this component.
|
void |
invalidate()
Invalidates this component by setting the dirty flag
such that it will be redraw the whole content of this
component and its dependencies later.
|
boolean |
isDisabled()
Returns whether it is disabled.
|
boolean |
isOpen()
Returns whether this cascader is open.
|
void |
onInitRender()
Handles a private event, onInitRender.
|
void |
onPageAttached(Page newpage,
Page oldpage)
Default: handles special event listeners.
|
void |
onPageDetached(Page page)
Default: handles special event listeners.
|
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing
tags and children.
|
void |
service(AuRequest request,
boolean everError)
Processes an AU request.
|
void |
sessionDidActivate(Page page)
Notification that the session, which owns this component,
has just been activated (a.k.a., deserialized).
|
void |
sessionWillPassivate(Page page)
Notification that the session, which owns this component,
is about to be passivated (a.k.a., serialized).
|
void |
setDisabled(boolean disabled)
Sets whether it is disabled.
|
void |
setItemConverter(Converter<java.util.Collection<E>,java.lang.String> converter)
Sets the converter that generates the label text shown in the cascader
from selected items.
|
void |
setItemConverter(java.lang.String clsnm)
Sets the converter by use of a class name.
|
void |
setItemRenderer(ItemRenderer<E> renderer)
Sets the renderer which is used to render each item
if
getModel() is not null. |
void |
setItemRenderer(java.lang.String clsnm)
Sets the renderer by use of a class name.
|
void |
setModel(TreeModel model)
Sets the tree model associated with this cascader.
|
void |
setOpen(boolean open)
Drops down or closes the list of items.
|
void |
setPlaceholder(java.lang.String placeholder)
Sets the placeholder text that is displayed when the selected item is empty.
|
void |
setSelectedItem(E item)
Deselects selected item and selects the given item.
|
addSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getPropertyAccess, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidatePartial, isChildable, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
invalidatePartial
public TreeModel<E> getModel()
public void setModel(TreeModel model)
model
- the list model to associate, or null to dis-associate any
previous model. If not null, it must implement Selectable
.UiException
- if failed to initialize with the modelpublic void onInitRender()
public ItemRenderer<E> getItemRenderer()
public void setItemRenderer(ItemRenderer<E> renderer)
getModel()
is not null.
Note: changing a render will cause the cascader to re-render.
renderer
- the renderer, or null to use the default.public void setItemRenderer(java.lang.String clsnm) throws java.lang.ReflectiveOperationException
clsnm
- The class namejava.lang.ReflectiveOperationException
- if failed to initialize the rendererpublic Converter<java.util.Collection<E>,java.lang.String> getItemConverter()
public void setItemConverter(Converter<java.util.Collection<E>,java.lang.String> converter)
converter
- the converter, or null to use the default implementation.public void setItemConverter(java.lang.String clsnm) throws java.lang.ReflectiveOperationException
clsnm
- The class namejava.lang.ReflectiveOperationException
- if failed to initialize the converterpublic java.lang.String getPlaceholder()
public void setPlaceholder(java.lang.String placeholder)
public boolean isOpen()
Default: false.
public void setOpen(boolean open)
public boolean isDisabled()
Disable
Default: false.
isDisabled
in interface Disable
public void setDisabled(boolean disabled)
Disable
setDisabled
in interface Disable
public java.util.Set<E> getSelectedItems()
public E getSelectedItem()
public void setSelectedItem(E item)
protected void renderProperties(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponent
renderProperties
in class HtmlBasedComponent
java.io.IOException
public void service(AuRequest request, boolean everError)
HtmlBasedComponent
Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.
service
in interface ComponentCtrl
service
in class HtmlBasedComponent
everError
- whether any error ever occurred before
processing this request.AbstractComponent.setAuService(org.zkoss.zk.au.AuService)
public void onPageAttached(Page newpage, Page oldpage)
AbstractComponent
onPageAttached
in interface ComponentCtrl
onPageAttached
in class AbstractComponent
newpage
- the new page (never null).oldpage
- the previous page, if any, or null if it didn't
belong to any page.ComponentCtrl.onPageAttached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Page)
public void onPageDetached(Page page)
AbstractComponent
onPageDetached
in interface ComponentCtrl
onPageDetached
in class AbstractComponent
page
- the previous page (never null)ComponentCtrl.onPageDetached(org.zkoss.zk.ui.Page)
public void invalidate()
Component
If the application is totally controlled by the server side (i.e., you don't write client codes), you rarely need to access this method.
It can be called only in the request-processing and event-processing phases. However, it is NOT allowed in the rendering phase.
invalidate
in interface Component
invalidate
in class AbstractComponent
public java.lang.Object clone()
Component
clone
in interface Component
clone
in class HtmlBasedComponent
public void sessionWillPassivate(Page page)
ComponentCtrl
Note: only root components are notified by this method.
sessionWillPassivate
in interface ComponentCtrl
sessionWillPassivate
in class AbstractComponent
public void sessionDidActivate(Page page)
ComponentCtrl
Note: only root components are notified by this method.
sessionDidActivate
in interface ComponentCtrl
sessionDidActivate
in class AbstractComponent
public java.lang.String getZclass()
HtmlBasedComponent
AbstractComponent.getMold()
).
Default: null (the default value depends on element).
HtmlBasedComponent.setZclass(java.lang.String)
) will completely replace the default style
of a component. In other words, the default style of a component
is associated with the default value of HtmlBasedComponent.getZclass()
.
Once it is changed, the default style won't be applied at all.
If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String)
instead.
getZclass
in class HtmlBasedComponent
HtmlBasedComponent.getSclass()
Copyright © 2005-2021 Potix Corporation. All Rights Reserved.