Class Confirmpopup
- All Implemented Interfaces:
Serializable,Cloneable,Component,Scope,ComponentCtrl
Messagebox, anchored to
a trigger component. Fires Events.ON_OK when the user confirms,
Events.ON_CANCEL when they cancel or dismiss.
Default getZclass(): "z-confirmpopup".
- Since:
- 11.0.0
- Author:
- yuehfeng
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
HtmlBasedComponent.ExtraCtrlNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children, AbstractComponent.ForwardInfo, AbstractComponent.TargetInfo -
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 TypeMethodDescriptionReturns the icon CSS class shown beside the message.Returns the confirmation message shown in the popup body.Returns the severity, which drives the icon/color styling of the popup.getTitle()Returns the optional title row shown above the message body.Returns the ZK Cascading Style class for this component.booleanDefault: not childable.protected voidrenderProperties(ContentRenderer renderer) Renders the content of this component, excluding the enclosing tags and children.voidsetDefaultFocus(String defaultFocus) Sets which button gets keyboard focus when the popup opens.voidsetIconSclass(String iconSclass) Sets the icon CSS class.voidsetMessage(String message) Sets the confirmation message shown in the popup body.voidsetPlacement(String placement) Sets the placement of this popup relative to the trigger element.voidsetSeverity(String severity) Sets the severity, which drives the icon/color styling of the popup.voidSets the optional title row shown above the message body.Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, 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, getExtraCtrl, 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, beforeChildAdded, 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, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
Constructor Details
-
Confirmpopup
public Confirmpopup() -
Confirmpopup
-
-
Method Details
-
getTitle
Returns the optional title row shown above the message body.- Since:
- 11.0.0
-
setTitle
Sets the optional title row shown above the message body.- Parameters:
title- the title text;nullor an empty string clears it (the popup renders with no title row). Pushes the change to the client viasmartUpdate.- Since:
- 11.0.0
-
getMessage
Returns the confirmation message shown in the popup body.Default:
null(no message).- Since:
- 11.0.0
-
setMessage
Sets the confirmation message shown in the popup body.- Parameters:
message- the message text;nullor an empty string clears it. Pushes the change to the client viasmartUpdate.- Since:
- 11.0.0
-
getIconSclass
Returns the icon CSS class shown beside the message.Default: "z-icon-exclamation-triangle". An empty string means the icon is explicitly suppressed (no icon node is rendered).
- Since:
- 11.0.0
-
setIconSclass
Sets the icon CSS class.nullrestores the default ("z-icon-exclamation-triangle").- An empty string explicitly suppresses the icon — the popup renders with no icon node.
- Any other value is used as the icon's CSS class.
-
getSeverity
Returns the severity, which drives the icon/color styling of the popup.Default: "warning". One of "info", "success", "warning", "error" or "neutral".
- Since:
- 11.0.0
-
setSeverity
Sets the severity, which drives the icon/color styling of the popup.- Parameters:
severity- one of "info", "success", "warning", "error" or "neutral";nullrestores the default ("warning"). Pushes the change to the client viasmartUpdate.- Throws:
WrongValueException- ifseverityis non-null and is not one of the accepted tokens.- Since:
- 11.0.0
-
getPlacement
- Returns:
- the placement of this popup relative to the trigger element. One of "top" (default) / "bottom" / "left" / "right". The arrow points from this popup toward the trigger.
- Since:
- 11.0.0
-
setPlacement
Sets the placement of this popup relative to the trigger element.- Parameters:
placement- one of "top" (default), "bottom", "left" or "right";nullrestores the default ("top"). Pushes the change to the client viasmartUpdate.- Throws:
WrongValueException- ifplacementis non-null and is not one of the accepted tokens.- Since:
- 11.0.0
-
getDefaultFocus
- Returns:
- which button gets keyboard focus when the popup opens — either "ok" (default) or "cancel". For destructive operations (severity="error"), prefer "cancel" so an accidental Enter keypress does not commit the action.
- Since:
- 11.0.0
-
setDefaultFocus
Sets which button gets keyboard focus when the popup opens.- Parameters:
defaultFocus- either "ok" (default) or "cancel";nullrestores the default ("ok"). For destructive operations (severity="error"), prefer "cancel" so an accidental Enter keypress does not commit the action. Pushes the change to the client viasmartUpdate.- Throws:
WrongValueException- ifdefaultFocusis non-null and is neither "ok" nor "cancel".- Since:
- 11.0.0
-
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 classXulElement- Throws:
IOException
-
isChildable
public boolean isChildable()Default: not childable. The mold renders only the title row, the message body and the two footer buttons, so a child would never appear.- Overrides:
isChildablein classAbstractComponent
-