Best way to implement a confirmation dialog

Hi,

I need the users to confirm when they request to delete something. 

Right now, it seems to me that the only way to do this is through a modal sub-window. It seems heavy for a simple confirmation. 

The Error message notification implementation was quite close to what I need, just need two buttons... 

Anyway, what is the best way to implement a confirmation dialog? 

Thanks,

Jason.

Hi Jason,

seems to be a common problem… here’s a recent discussion about how to implement confirmation dialogs:


http://vaadin.com/forum/-/message_boards/message/17883

HTH, Maik

Hi Jason,

in addition to recent talks on this, Maik posted a link to, the ways to popup a confirmation dialog are actually two:

  1. Use modal window. Why do you calit heavy ? It just a div in a browser with some content. In the Maik’s link above you’ll find an examples on how to do this. You can also watch the code and live examples on
    my tpt’s live demo page

  2. In Vaadin 6.2 and above you can use the “executeJS” method of a window to invoke a native snipped of JS code - in this code you may raise a message dialog, however, there will be a synchronization problems in case you’ll want to wait the user reaction and continue.

Thanks for the reply.

I got it. The TPT package looks strong. Many of the gadgets are quite useful. Thanks for sharing.

Is there plan to include some of these gadgets in the future releases of vaadin? I am a bit concerned about adding a separate library because of maintainability in the future…

Jason

There were talks about implementing confirmation dialogs support in Vaadin core. Anyway, you may create a request on Vaadin’s uservoice to get your requests promoted.

Regarding the TPT - it is server side only (no custom widgetsets) and I plan to keep it the same way later - for the same maintainability reasons, so there should not be any huge maint. issues in the future, also it is going to stay opensourced forever :wink: