Notifications
Notifications are pop-up messages displayed to inform users about activities, processes, and events in the application.
To show a notification, inject the Notifications
bean into the view class and use its fluent interface. In the following example, a notification with default parameters is shown on the button click:
@Autowired
private Notifications notifications;
@Subscribe("helloButton")
public void onHelloButtonClick(ClickEvent<Button> event) {
notifications.show("Hello");
}
Below is an example of a parameterized notification:
notifications.create("Hello")
.withType(Notifications.Type.WARNING)
.withPosition(Notification.Position.BOTTOM_END)
.withDuration(3000)
.show();