Messagebox

It provides a set of utilities to show message boxes.

It is typically used to alert users when an error occurs, or to prompt user for an decision.

<window title="Messagebox demo" border="normal">
    <button label="Question" width="100px">    
        <attribute name="onClick">{        
            Messagebox.show("Question is pressed. Are you sure?", "Question",            
            Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION);            
        }</attribute>        
    </button>    
</window>

Class Name

org.zkoss.zul.Messagebox

Properties

Property

Description

Data Type

Default Value

template

Sets the template used to create the message dialog.

String

~./zul/html/messagebox.zul

Methods

Name

Description

Return Data Type

Show(int messageCode, int titleCode, int button, java.lang.String icon)

Shows a message box by specifying a message code, and returns what button is pressed.

int

show(int messageCode, java.lang.Object[] args, int titleCode, int button, java.lang.String icon)

Shows a message box by specifying a message code, and returns what button is pressed.

int

show(int messageCode, java.lang.Object arg, int titleCode, int button, java.lang.String icon)

Shows a message box by specifying a message code, and returns what button is pressed.

int

show(java.lang.String message)

Shows a message box and returns what button is pressed.

int

show(java.lang.String message, java.lang.String title, int buttons, java.lang.String icon)

Shows a message box and returns what button is pressed.

int