NotificationFacet is a facet that allows you to pre-configure a notification. Declarative definition of the notification replaces existing Notifications.create() method.

Component’s XML-name: notification.


NotificationFacet is defined in the facets element of the screen XML descriptor and has the following attributes:

You can bind NotificationFacet to action or button. In those cases, the notification will appear when action is fires or button clicks. To aware NotificationFacet with action or button, use the following attributes:

  • onAction

<window xmlns=""
        <action id="facetAction"
                caption="Action subscription"/>
        <notification id="actionNotification"
                      caption="Action performed"
  • onButton

<window xmlns=""
        <notification id="buttonNotification"
                      caption="Button clicked"
        <button id="facetBtn"
                caption="Button subscription"/>

You can also make notification configured with ScreenFacet to appear using the show() method:

private NotificationFacet notificationFacet;

public void onBtnClick(Button.ClickEvent event) {;

Events and Handlers

To generate a handler stub in Jmix Studio, select the facet in the screen descriptor XML or in the Jmix UI hierarchy panel and use the Handlers tab of the Jmix UI inspector panel.

Alternatively, you can use the Generate Handler button in the top panel of the screen controller.


CloseEvent allows you to handle the closure of notification. For example:

private static final Logger log = LoggerFactory.getLogger(NotificationFacetScreen.class);

public void onActionNotificationClose(Notifications.CloseEvent event) {"Notification was closed");

Programmatic registration of the event handler: use the addCloseListener() component method.


To change the displayed caption of notification, NotificationFacet has CaptionProvider.

@Install(to = "actionNotification", subject = "captionProvider")
private String actionNotificationCaptionProvider() {
    return "Changed caption";

Programmatic usage: call the setCaptionProvider() component method.


To change the displayed description of notification, NotificationFacet has DescriptionProvider.

@Install(to = "actionNotification", subject = "descriptionProvider")
private String actionNotificationDescriptionProvider() {
    return "Changed description";

Programmatic usage: call the setDescriptionProvider() component method.

All XML Attributes

You can view and edit attributes applicable to the facet using the Jmix UI inspector panel of the Studio’s Screen Designer.