Package org.zkoss.zul

Class Confirmpopup

All Implemented Interfaces:
Serializable, Cloneable, Component, Scope, ComponentCtrl

public class Confirmpopup extends Popup
An inline confirmation popup — lighter than 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:
  • Constructor Details

    • Confirmpopup

      public Confirmpopup()
    • Confirmpopup

      public Confirmpopup(String message)
  • Method Details

    • getTitle

      public String getTitle()
      Returns the optional title row shown above the message body.
      Since:
      11.0.0
    • setTitle

      public void setTitle(String title)
      Sets the optional title row shown above the message body.
      Parameters:
      title - the title text; null or an empty string clears it (the popup renders with no title row). Pushes the change to the client via smartUpdate.
      Since:
      11.0.0
    • getMessage

      public String getMessage()
      Returns the confirmation message shown in the popup body.

      Default: null (no message).

      Since:
      11.0.0
    • setMessage

      public void setMessage(String message)
      Sets the confirmation message shown in the popup body.
      Parameters:
      message - the message text; null or an empty string clears it. Pushes the change to the client via smartUpdate.
      Since:
      11.0.0
    • getIconSclass

      public 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:
      11.0.0
    • setIconSclass

      public void setIconSclass(String iconSclass)
      Sets the icon CSS class.
      • null restores 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 String 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

      public void setSeverity(String severity) throws WrongValueException
      Sets the severity, which drives the icon/color styling of the popup.
      Parameters:
      severity - one of "info", "success", "warning", "error" or "neutral"; null restores the default ("warning"). Pushes the change to the client via smartUpdate.
      Throws:
      WrongValueException - if severity is non-null and is not one of the accepted tokens.
      Since:
      11.0.0
    • getPlacement

      public 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:
      11.0.0
    • setPlacement

      public void setPlacement(String placement) throws WrongValueException
      Sets the placement of this popup relative to the trigger element.
      Parameters:
      placement - one of "top" (default), "bottom", "left" or "right"; null restores the default ("top"). Pushes the change to the client via smartUpdate.
      Throws:
      WrongValueException - if placement is non-null and is not one of the accepted tokens.
      Since:
      11.0.0
    • getDefaultFocus

      public String 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

      public void setDefaultFocus(String defaultFocus) throws WrongValueException
      Sets which button gets keyboard focus when the popup opens.
      Parameters:
      defaultFocus - either "ok" (default) or "cancel"; null restores 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 via smartUpdate.
      Throws:
      WrongValueException - if defaultFocus is non-null and is neither "ok" nor "cancel".
      Since:
      11.0.0
    • getZclass

      public String getZclass()
      Description copied from class: HtmlBasedComponent
      Returns 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 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.

      Overrides:
      getZclass in class Popup
      See Also:
    • renderProperties

      protected void renderProperties(ContentRenderer renderer) throws IOException
      Description copied from class: HtmlBasedComponent
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
      renderProperties in class XulElement
      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:
      isChildable in class AbstractComponent