Directory

← Back

MessageBox

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

Author

Rating

Popularity

100+

*** 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

Migration of addon from Vaadin 7 to 8.

Released
2017-04-22
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 8.0+
Vaadin 7.2+ in 3.0.19
Vaadin 7.0+ in 3.0.4
Vaadin 6.7+ in 1.1.3
Vaadin 6.0+ in 1.1.1
Browser
Browser Independent

MessageBox - Vaadin Add-on Directory

NEW SYNTAX +++ Creates modal message and confirm dialogs. It is easy to use and reach of features. MessageBox - Vaadin Add-on Directory
*** 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.
Author Homepage
SVN Repository
Discussion Forum
Source Code
Online Demo
JavaDoc

MessageBox version 1.0.0
Initial version

MessageBox version 1.0.1
IMPROVEMENTS: - The layout of the dialog components is improved. Now, the dialog height increases automatically with the content of the message. Only the dialog width have to be set, if required. The default value is 350px. BUGFIXES: - The member field BUTTON_DEFAULT_ALIGNMENT is not ignored anymore. - The dialog window does not show anymore an "x"-Button in the caption bar. Now, the user have to press a button.

MessageBox version 1.0.2
BUGFIX: - The icon was loaded lazy, but the GridLayout does not recalculates the layout after it. That causes, that the buttons disappear. I have fixed the problem by setting a fix icon size.

MessageBox version 1.0.3
A VisibilityInterceptor is implemented. Now, you can add some more eye candy to the MessageBox e.g. using the Animator (https://vaadin.com/directory#addon/animator) AddOn with fading effects. Also see the code example.

MessageBox version 1.1.0
Serious bug fixed with the icon resources: The icons were only available in the first user session.

MessageBox version 1.1.1
Improved exception handling for the EventListener. The exception inside the EventListener has not to be catched anymore. Now, the dialog closes always.

MessageBox version 1.1.3
Icons added, that where missing in V.1.1.2

MessageBox version 2.0.1
Compiled with Java 6

MessageBox version 2.0.2
Maven support for the addon built for Vaadin 7+

MessageBox version 2.0.3
Vaadin7 addon is switched to maven.

MessageBox version 2.0.4
Small bug in the pom.xml fixed. No API change. Thanks for reporting, Mario.

MessageBox version 2.0.5
Problem fixed with compiling the widgetset.

MessageBox version 2.0.6
Missing WidgetSet.gwt.xml added.

MessageBox version 2.0.7
I18n for French, Italian, Japanese, Russian and Spanish supported.

MessageBox version 2.1.3
Support for more than 40 languages added! Invalid parent section removed from pom.xml.

MessageBox version 3.0.2
***Xmas special***: New syntax introduced. You create the dialog with very flexible and narrative method chaining. Additionally, more than 40 languages are supported. Have fun with it!

MessageBox version 2.1.4
Support for more than 40 languages added! Invalid parent section removed from pom.xml. Unnecessary dependencies removed.

MessageBox version 3.0.3
***Xmas special***: New syntax introduced. You create the dialog with very flexible and narrative method chaining. Additionally, more than 40 languages are supported. Have fun with it!

MessageBox version 3.0.4
***Xmas special***: New syntax introduced. You create the dialog with very flexible and narrative method chaining. Additionally, more than 40 languages are supported. Have fun with it!
pom.xml and MANIFEST.MF fixed.

MessageBox version 3.0.5
***Xmas special***: New syntax introduced. You create the dialog with very flexible and narrative method chaining. Additionally, more than 40 languages are supported. Have fun with it!

New icon sets added based on FontAwesome.

MessageBox version 3.0.12
Javadoc and sources added to maven repos.

MessageBox version 3.0.15
Maven driven release.

MessageBox version 3.0.16
Minor NPE fixed; Vaadin dependencies set to V7.6.4 in order of a security alert.

MessageBox version 3.0.17
Japanese translation fixed

MessageBox version 3.0.18
ButtonOption.disable() and MessageBox.getButton(...) added. Test the new features at example no. 25 of my demo.

MessageBox version 3.0.19
Static method setButtonAddClosePerDefault() added.

MessageBox version 4.0.20
Migration of addon from Vaadin 7 to 8.

MessageBox version 4.0.21
Migration to Vaadin 8. Support for VaadinIcons added and FontAwesome factories set to deprecated.

Online