What is the unit of measure used in time duration of Notification

Question to Jmix team, what is the unit of measure of duration, milliseconds, seconds or minutes? I tried it seems it is not even in minutes (greater) or it’s not working as expected.

notifications.create("Hello")
        .withType(Notifications.Type.WARNING)
        .withPosition(Notification.Position.BOTTOM_END)
        .withDuration(3000)
        .show();

Milliseconds.
It’s usually described in Javadocs:
image

Yes, thanks but in my project (FlowUI Composite), the notification stays beyond the set duration until i manually close it. Wondering if there is any bug for FlowUI.

Thanks for the report, we’ll check it.

1 Like

Hello!

For the Notifications bean in Flow UI:

notifications with Warning, Error, System types by default have an icon to close notification and duration property is ignored.
image

If you want to close such notifications by duration you should also set withCloseable(false):

@Autowired
private Notifications notifications;

notifications.create("Hello")
        .withType(Notifications.Type.WARNING)
        .withPosition(Notification.Position.BOTTOM_END)
        .withDuration(3000) //  in milliseconds
        .withCloseable(false)
        .show();
2 Likes

Thank you.