Add-on: ConfirmDialog

Small announcement: Recently extracted another piece of useful code from the
Uilder
:

ConfirmDialog:
http://vaadin.com/addon/confirmdialog

This should me most useful building up quickly small apps, but it should be generic enough to fit into any Vaadin application. The component is server-side-only so you can avoid the widgetset compilation.

Hello,

I am a french user and I get an exception while trying to use this addon :

Caused by: java.lang.IllegalArgumentException: Invalid size argument: "2,5em" (should match ^(-?\d+(\.\d+)?)(%|px|em|ex|in|cm|mm|pt|pc)?$)
	at com.vaadin.ui.AbstractComponent.parseStringSize(AbstractComponent.java:1395)

In France we use the coma “,” as the separator for decimals.

    /**
     * Format a double single fraction digit.
     *
     * @param n
     * @return
     */
    private String format(double n) {
        NumberFormat nf = NumberFormat.getNumberInstance();
        nf.setMaximumFractionDigits(1);
        nf.setGroupingUsed(false);
        return nf.format(n);
    }

Should this method be calling NumberFormat.getNumberInstance(usLocale) instead of NumberFormat.getNumberInstance(), or as another user suggested, use buttons.setHeight(Double.toString(BUTTON_HEIGHT) + “em”) instead of buttons.setHeight(format(BUTTON_HEIGHT) + “em”);

Anyway the source link is broken so I cannot even modifiy the source to use this add-on :frowning:

EDIT => source is present in package, my mistake :slight_smile:

I get an error while using shortcut keys on confirm dialog :

java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
	at java.util.HashMap$KeyIterator.next(HashMap.java:828)
	at com.vaadin.event.ActionManager.handleAction(ActionManager.java:213)
	at com.vaadin.event.ActionManager.handleActions(ActionManager.java:186)
	at com.vaadin.ui.Panel.changeVariables(Panel.java:348)
	at com.vaadin.ui.Window.changeVariables(Window.java:950)
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVaria...

This seems to be an old message, I had missed. Anyway, I haven’t encountered the same at least with the latest versions. There also is a keyboard support in the ConfirmDialog itself currently.
vaadin.com/addon/confirmdialog

The demo doesn’t seem to be working.

Also if someone could help me figure out how to set the content mode for the message to raw? ConfirmDialog#setContentMode() isn’t visible for me. Thanks!

Hi, how I can simply change Button for NativeButton and keep the same function?