Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
How/Where does *wizardCancelledEvent* get called?
Hi guys,
I am currently using wizards for vaadin and I simply want my wizard to end properly when I click on the "Cancel" button.
How do I achieve this? I know that Wizards for Vaadin provides us with predefined methods such as wizardCancelled but this doesnt really seem to work:
public void wizardCancelled(WizardCancelledEvent event) {
endWizard("Wizard cancelled!");
Notification notification = new Notification("Wizard cancelled!");
notification.setDelayMsec(1000);
notification.show(Page.getCurrent());
}
When I click on cancel, nothing happens. Not even the notification shows. Do I need to do anything else?
Hi,
I haven't tried it, but looking at the Wizards for Vaadin source, it looks like a WizardCancelledEvent should be fired when the Cancel button is pressed. Your snippet only shows a method that takes an event parameter; do you also have a listener added to your wizard? From the Wizard's source docs:
* To react on the progress, cancellation or completion of this {@code Wizard}
* you should add one or more listeners that implement the
* {@link WizardProgressListener} interface. These listeners are added using the
* {@link #addListener(WizardProgressListener)} method and removed with the
* {@link #removeListener(WizardProgressListener)}.
I must have totally missed adding the listener in my wizard constructor! I will try this out, thanks :-)
I added the listener and as expected, this solved the issue right away. Now my Cancel gets called properly as intended, thx!