Good day. Please tell me how to get the state of the pressed button on the

Good day. Please tell me how to get the state of the pressed button on the form of this component in Java code. I could not find how to contact them. I need to get true \ false values depending on the clicked cancel or confirm button. Thanks.

Try the new version 1.1.0, the following code will do.

sweetAlert2Vaadin.addConfirmListener(e->{
 System.out.println("confirm result : "+e.getSource().getSweetAlert2Result());
});
sweetAlert2Vaadin.addCancelListener(e->{
 System.out.println("cancel result : "+e.getSource().getSweetAlert2Result());
});
sweetAlert2Vaadin.addCloseListener(e->{
 System.out.println("close result : "+e.getSource().getSweetAlert2Result());
});
sweetAlert2Vaadin.addDenyListener(e->{
 System.out.println("deny result : "+e.getSource().getSweetAlert2Result());
});

Good afternoon Ryan. Thank you for quick answer. That helped.

Suggestions for further refinement of this component (What I encountered when using it):

  • implement the close method for the dialog
  • For methods
    config.setShowClass ();
    config.setHideClass ();
    to create
  1. Class wrapper for passing arguments
  2. Modify methods to use this class
    P.S. Perhaps it is worth making a common logic and object
  • The ability to transfer objects of components to the dialog
  • a listener for transferring an imput

thank

Good suggestion, they will be in consideration in future release.
Thanks Andrey.