Directory

← Back

MessageBox

NEW SYNTAX +++ Creates modal message and confirm dialogs. It is easy to use and reach of features.

Author

Rating

*** Please vote to honor my work.***

Version 4.x.x: Vaadin 8.0.5+
Version 3.x.x: Vaadin 7.2+ with method chaining syntax
Version 2.x.x: Vaadin 7+
Version 1.1.x: Vaadin 6.7+

The ONLINE DEMO is deactivated since 2018-05-04. Openshift continously disables my account. It annoys me and I am not longer interested in Openshift. If you know another free vm provider, please let me know. Thanks!

DESCRIPTION

You simply want to show a message dialog? Unfortunally, Vaadin does not offer such a dialog. This add-on closes this gap. Now, the button captions are translated to more than 40 languages!

USAGE

It's very simple, flexible and self-explaining code:

MessageBox
    .createInfo()
    .withCaption("Info")
    .withMessage("Hello World!")
    .withOkButton(() -> System.out.println("Ok pressed."))
    .open();

You can add more buttons with button listeners. But you can do much more. Test the demo to find out all features!

THANK YOU

I thank all contributors for the i18n, bug reports and ideas. It helps me a lot to improve the quality of this addon. Also I am glad about so much feedback. That is the cause, why I write open source and I maintain this addon.

Sample code

MessageBox
    .createInfo()
    .withCaption("Example 1")
    .withMessage("Hello World!")
    .withOkButton()
    .open();
MessageBox
    .createQuestion()
    .withCaption("Example 6")
    .withMessage("Do you really want to continue?")
    .withYesButton(() -> { System.out.println("Yes button was pressed."); })
    .withNoButton(() -> { System.out.println("No button was pressed."); })
    .open();
MessageBox
    .create()
    .createCaption("Example 9")
    .createMessage("Long plain text has to be broken manually with an '\\n':\n1. line\n2. line\n3. line\n4. line\n5. line\n6. line")
    .open();
MessageBox
    .createInfo()
    .withCaption("Custom button captions")
    .withMessage("Button captions replaced!")
    .withYesButton(ButtonOption.caption("Yea"))
    .withNoButton(ButtonOption.caption("Nay"))
    .open()

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Initial version

Released
2012-06-01
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.0+
Vaadin 6.7+ in 1.1.3
Vaadin 7.0+ in 2.0.1
Vaadin 7.2+ in 3.0.5
Vaadin 8.0+ in 4.0.20
Browser
Browser Independent

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online