I have added a listener to a button and added the following code - the first line shows up in my console but the confirm dialog does not show up nor any exception in the logs.
pom file attached.
private void openOwnersDialog(ClickEvent<Button> event) {
System.out.println("Called"); //This is called
ConfirmDialog dialog = new ConfirmDialog("Unsaved changes",
"Do you want to save or discard your changes before navigating away?",
"Save", this::onSave);
}
public void onSave(ConfirmEvent l) {
}
Damn, thank you I was looking for the show method (that used to be on the old confirmed dialog) .
All examples in Vaadin doesn’t show the call to open method.
You are right, in the [examples page]
(https://vaadin.com/components/vaadin-confirm-dialog/java-examples) for ConfirmDialog, no example actually shows the dialog.open(); line. And you were not the first today to ask exactly this question :). Hopefully the examples get updated some time.