Package org.zkoss.zul
Class Confirmpopup
- java.lang.Object
-
- org.zkoss.zk.ui.AbstractComponent
-
- org.zkoss.zk.ui.HtmlBasedComponent
-
- org.zkoss.zul.impl.XulElement
-
- org.zkoss.zul.Popup
-
- org.zkoss.zul.Confirmpopup
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl
public class Confirmpopup extends Popup
An inline confirmation popup — lighter thanMessagebox, anchored to a trigger component. FiresEvents.ON_OKwhen the user confirms,Events.ON_CANCELwhen they cancel or dismiss.Default
getZclass(): "z-confirmpopup".- Since:
- 10.4.0
- Author:
- yuehfeng
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Confirmpopup()Confirmpopup(java.lang.String message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDefaultFocus()java.lang.StringgetHeader()Returns the optional header (title row) shown above the message body.java.lang.StringgetIconSclass()Returns the icon CSS class shown beside the message.java.lang.StringgetMessage()Returns the confirmation message shown in the popup body.java.lang.StringgetPlacement()java.lang.StringgetSeverity()Returns the severity, which drives the icon/color styling of the popup.java.lang.StringgetZclass()protected voidrenderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)voidsetDefaultFocus(java.lang.String defaultFocus)Sets which button gets keyboard focus when the popup opens.voidsetHeader(java.lang.String header)Sets the optional header (title row) shown above the message body.voidsetIconSclass(java.lang.String iconSclass)Sets the icon CSS class.voidsetMessage(java.lang.String message)Sets the confirmation message shown in the popup body.voidsetPlacement(java.lang.String placement)Sets the placement of this popup relative to the trigger element.voidsetSeverity(java.lang.String severity)Sets the severity, which drives the icon/color styling of the popup.-
Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, 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, getExtraCtrl, 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, 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, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isChildable, 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, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
-
-
-
Method Detail
-
getHeader
public java.lang.String getHeader()
Returns the optional header (title row) shown above the message body. Mirrors PrimeNG Confirmpopup'sheaderproperty.- Since:
- 10.4.0
-
setHeader
public void setHeader(java.lang.String header)
Sets the optional header (title row) shown above the message body.- Parameters:
header- the header text;nullor an empty string clears it (the popup renders with no title row). Pushes the change to the client viasmartUpdate.- Since:
- 10.4.0
-
getMessage
public java.lang.String getMessage()
Returns the confirmation message shown in the popup body.Default:
null(no message).- Since:
- 10.4.0
-
setMessage
public void setMessage(java.lang.String message)
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:
- 10.4.0
-
getIconSclass
public java.lang.String 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:
- 10.4.0
-
setIconSclass
public void setIconSclass(java.lang.String iconSclass)
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
public java.lang.String getSeverity()
Returns the severity, which drives the icon/color styling of the popup.Default: "warning". One of "info", "success", "warning", "danger" or "secondary".
- Since:
- 10.4.0
-
setSeverity
public void setSeverity(java.lang.String severity) throws org.zkoss.zk.ui.WrongValueExceptionSets the severity, which drives the icon/color styling of the popup.- Parameters:
severity- one of "info", "success", "warning", "danger" or "secondary";nullrestores the default ("warning"). Pushes the change to the client viasmartUpdate.- Throws:
org.zkoss.zk.ui.WrongValueException- ifseverityis non-null and is not one of the accepted tokens.- Since:
- 10.4.0
-
getPlacement
public java.lang.String 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:
- 10.4.0
-
setPlacement
public void setPlacement(java.lang.String placement) throws org.zkoss.zk.ui.WrongValueExceptionSets 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:
org.zkoss.zk.ui.WrongValueException- ifplacementis non-null and is not one of the accepted tokens.- Since:
- 10.4.0
-
getDefaultFocus
public java.lang.String getDefaultFocus()
- Returns:
- which button gets keyboard focus when the popup opens — either "ok" (default) or "cancel". For destructive operations (severity="danger"), prefer "cancel" so an accidental Enter keypress does not commit the action.
- Since:
- 10.4.0
-
setDefaultFocus
public void setDefaultFocus(java.lang.String defaultFocus) throws org.zkoss.zk.ui.WrongValueExceptionSets which button gets keyboard focus when the popup opens.- Parameters:
defaultFocus- either "ok" (default) or "cancel";nullrestores the default ("ok"). For destructive operations (severity="danger"), prefer "cancel" so an accidental Enter keypress does not commit the action. Pushes the change to the client viasmartUpdate.- Throws:
org.zkoss.zk.ui.WrongValueException- ifdefaultFocusis non-null and is neither "ok" nor "cancel".- Since:
- 10.4.0
-
renderProperties
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException- Overrides:
renderPropertiesin classXulElement- Throws:
java.io.IOException
-
-