Redirecting to another page when the Notification X is clicked

hi everyone. my app is working fine but im trying to tidy it up a bit. when a user makes a new account, a successful message is shown. when they click the x. they have to click a back link. i would like to redirect them when the x is clicked. here is my notification pop up. im using vaadin 7 by the way.

popUp = new Notification(Constants.SUCCESSFUL, Type.WARNING_MESSAGE);
popUp.setDelayMsec(20000);
popUp.setStyleName(ValoTheme.NOTIFICATION_SUCCESS + " " + ValoTheme.NOTIFICATION_CLOSABLE);
popUp.show(Page.getCurrent());

here is the UI that i would like to redirect to when the notification window is closed. could anyone give me a hand?
UI.getCurrent().getPage().setLocation(Constants.HOME);

thanks community

Hey,
try

popUp.addCloseListener(event -> UI.getCurrent().getPage().setLocation(Constants.HOME));

but the users is also redirected if the delay is up. (if you don’t want the users to press any buttons others than the notification set the delay to -1)

hi michael. im using vaadin 7 and i dont believe it has that listener. i dont have the addcloselistener option when i check its methods. is there a way to force vaadin 8 on the notification alone? i tried upgrading to vaadin 8 but it broke a lot of things. :confused:
42002.png

Hey,
sorry I somehow overlooked that.
Did you try migrating with the
compatibility packages
?
I think an updated for Notification only is not possible :frowning:

If you need to stick to Vaadin 7, you could do something similiar with a custom [Extension]
(https://vaadin.com/docs/v7/framework/gwt/gwt-extension.html).

-Olli