Class Combobutton
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Component,Disable,Scope,Uploadable,ComponentCtrl
public class Combobutton extends Button
A combo button. A combo button consists of a buttonCombobuttonand a popup windowPopup. It is similar toBandboxexcept the input box is changed to button.Default
getZclass(): z-combobutton. IfAbstractComponent.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 whenOpenEvent.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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.zkoss.zul.impl.LabelImageElement
LabelImageElement.ExtraCtrl
-
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children, AbstractComponent.ForwardInfo, AbstractComponent.TargetInfo
-
Nested classes/interfaces inherited from interface org.zkoss.zk.ui.ext.Uploadable
Uploadable.Error
-
-
Field Summary
-
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass
-
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
-
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, 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 Constructor Description Combobutton()Combobutton(java.lang.String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeChildAdded(Component newChild, Component refChild)Default: does nothing.voidclose()Closes the child if it was dropped down.PopupgetDropdown()Returns the dropdown window belonging to this combo button.java.lang.StringgetZclass()Returns the ZK Cascading Style class for this component.booleanisAutodrop()Returns whether to automatically drop the popup if user hovers on this Combobutton.protected booleanisChildable()No 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.voidservice(AuRequest request, boolean everError)Processes 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.voidsetUpload(java.lang.String upload)Combobutton does not support file upload-
Methods inherited from class org.zkoss.zul.Button
clone, getAutodisable, getDir, getHref, getOrient, getTarget, getType, getUpload, isDisabled, renderCrawlable, setAutodisable, setDir, setDisabled, setHref, setOrient, setTarget, setType, updateByClient
-
Methods 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, setImageContent
-
Methods inherited from class org.zkoss.zul.impl.LabelElement
getLabel, setLabel
-
Methods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
-
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, 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, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
-
Methods 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, 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, 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 Detail
-
Combobutton
public Combobutton()
-
Combobutton
public Combobutton(java.lang.String value) throws WrongValueException- Throws:
WrongValueException
-
-
Method Detail
-
getDropdown
public Popup 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
public java.lang.String 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.- Overrides:
getZclassin classButton- See Also:
HtmlBasedComponent.getSclass()
-
renderProperties
protected void renderProperties(ContentRenderer renderer) throws java.io.IOException
Description copied from class:HtmlBasedComponentRenders the content of this component, excluding the enclosing tags and children.- Overrides:
renderPropertiesin classButton- Throws:
java.io.IOException
-
service
public void service(AuRequest request, boolean everError)
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:
AbstractComponent.setAuService(org.zkoss.zk.au.AuService)
-
beforeChildAdded
public void beforeChildAdded(Component newChild, Component refChild)
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:
ComponentCtrl.beforeChildAdded(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
-
isChildable
protected boolean isChildable()
Description copied from class:ButtonNo child is allowed.- Overrides:
isChildablein classButton
-
setUpload
public void setUpload(java.lang.String upload)
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:
Uploadable.Error
-
-