Class Combobutton
- All Implemented Interfaces:
Serializable,Cloneable,Component,Disable,Scope,Uploadable,ComponentCtrl
Combobutton and
a popup window Popup.
It is similar to Bandbox except the input box is changed
to button.
Default getZclass(): z-combobutton. If AbstractComponent.getMold() is toolbar,
"z-combobutton-toolbar" is assumed.(since 6.5.0)
Events: onClick
Developers can listen to the onClick event.
Events: onOpen
Developers can listen to the onOpen event and initializes it
when OpenEvent.isOpen() is true, and/or
clean up if false.
Note: to have better performance, onOpen is sent only if
a non-deferrable event listener is registered
(see Deferrable).
- Since:
- 6.0.0
- Author:
- benbai
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zul.impl.LabelImageElement
LabelImageElement.ExtraCtrlNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children, AbstractComponent.ForwardInfo, AbstractComponent.TargetInfoNested classes/interfaces inherited from interface org.zkoss.zk.ui.ext.Uploadable
Uploadable.Error -
Field Summary
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeChildAdded(Component newChild, Component refChild) Default: does nothing.voidclose()Closes the child if it was dropped down.Returns the dropdown window belonging to this combo button.Returns the ZK Cascading Style class for this component.booleanReturns whether to automatically drop the popup if user hovers on this Combobutton.protected booleanNo child is allowed.booleanisOpen()Returns whether this combobutton is open.voidopen()Drops down the child.protected voidrenderProperties(ContentRenderer renderer) Renders the content of this component, excluding the enclosing tags and children.voidProcesses an AU request.voidsetAutodrop(boolean autodrop) Sets whether to automatically drop the popup if user hovers on this Combobutton.voidsetOpen(boolean open) Drops down or closes the child, only works while visible.voidCombobutton does not support file uploadMethods inherited from class org.zkoss.zul.Button
clone, getAutodisable, getDir, getHref, getOrient, getTarget, getType, getUpload, isDisabled, renderCrawlable, setAutodisable, setDir, setDisabled, setHref, setOrient, setTarget, setType, updateByClientMethods inherited from class org.zkoss.zul.impl.LabelImageElement
getExtraCtrl, getHoverImage, getHoverImageContent, getIconSclass, getIconSclasses, getIconTooltip, getIconTooltips, getImage, getImageContent, getPropertyAccess, isImageAssigned, setHoverImage, setHoverImageContent, setHoverImageContent, setIconSclass, setIconSclasses, setIconTooltip, setIconTooltips, setImage, setImageContent, setImageContentMethods inherited from class org.zkoss.zul.impl.LabelElement
getLabel, setLabelMethods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setSkeleton, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, 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, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getStubonlyDescendants, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setStubonlyDescendants, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
Constructor Details
-
Combobutton
public Combobutton() -
Combobutton
- Throws:
WrongValueException
-
-
Method Details
-
getDropdown
Returns the dropdown window belonging to this combo button. -
isAutodrop
public boolean isAutodrop()Returns whether to automatically drop the popup if user hovers on this Combobutton.Default: false.
-
setAutodrop
public void setAutodrop(boolean autodrop) Sets whether to automatically drop the popup if user hovers on this Combobutton. -
setOpen
public void setOpen(boolean open) Drops down or closes the child, only works while visible. -
isOpen
public boolean isOpen()Returns whether this combobutton is open.Default: false.
- Since:
- 6.0.0
-
open
public void open()Drops down the child. The same as setOpen(true). -
close
public void close()Closes the child if it was dropped down. The same as setOpen(false). -
getZclass
Description copied from class:HtmlBasedComponentReturns the ZK Cascading Style class for this component. It usually depends on the implementation of the mold (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 ofHtmlBasedComponent.getZclass(). Once it is changed, the default style won't be applied at all. If you want to perform small adjustments, useHtmlBasedComponent.setSclass(java.lang.String)instead. -
renderProperties
Description copied from class:HtmlBasedComponentRenders the content of this component, excluding the enclosing tags and children.- Overrides:
renderPropertiesin classButton- Throws:
IOException
-
service
Description copied from class:HtmlBasedComponentProcesses an AU request.Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.
- Specified by:
servicein interfaceComponentCtrl- Overrides:
servicein classButtoneverError- whether any error ever occurred before processing this request.- See Also:
-
beforeChildAdded
Description copied from class:AbstractComponentDefault: does nothing.- Specified by:
beforeChildAddedin interfaceComponentCtrl- Overrides:
beforeChildAddedin classAbstractComponent- Parameters:
newChild- the child to be added (never null).refChild- another child component that the new child will be inserted before it. If null, the new child will be the last child.- See Also:
-
isChildable
protected boolean isChildable()Description copied from class:ButtonNo child is allowed.- Overrides:
isChildablein classButton
-
setUpload
Combobutton does not support file upload- Specified by:
setUploadin interfaceUploadable- Overrides:
setUploadin classButton- Parameters:
upload- a JavaScript class to handle the file upload at the client, or "true" if the default class is used, or null or "false" to disable the file download (and then this button behaves like a normal button).- See Also:
-