Closed alabotski closed 5 years ago
Nobody knows? (
@LeshaRB Sorry for keep you waiting, but I wanted to give a proper example, and I'm currently rather busy with other things.
1 What is different between DefaultNotificationHolder and DefaultBadgeHolder?
The difference is that the NotificationHolder can hold Notifications (f.e. Title + Description) and will keep track on how many are unread, order them by priority and time they were inserted (imaging a kind of news ticker) and display the unread count in a "badge". The BadgeHolder will only hold a plain number and bind it to a "badge".
2 How properly use DefaultNotificationHolder from View?
I will put a proper example example together, but this will require some time. I must admit that the access from the Views is rather problematic and currently probably rather dirty. Maybe @svenruppert has an clever idea how to make them easily accessible for the Views.
Thank you
Will be wait @svenruppert advice
@LeshaRB , let´s wait a little bit, please.. I just started some internal refactorings. After this, we should have a detailed look at this.
Postponed to 2.05.
2 How properly use DefaultNotificationHolder from View?
Use the following class AppLayoutBadges
to set the BadgeHolder
(via AppLayoutBadges::addBadgeWithIdentifier(holder,<String identifier>)
) in your AppLayoutRouterLayout
and access it from any view via `AppLayoutBadges::getBadge(
Use the following class AppLayoutNotification
to set the NotificationHolder
(via AppLayoutNotification::setNotificationHolder
) in your AppLayoutRouterLayout
and access it from anywhere via AppLayoutNotification::getNotificationHolder()
as long as your are running the command from an UI thread.
Some questions
1 What is different between DefaultNotificationHolder and DefaultBadgeHolder?
2 How properly use DefaultNotificationHolder from View?
For example
https://github.com/appreciated/vaadin-app-layout/blob/master/app-layout-addon/src/test/java/com/github/appreciated/MainView.java DefaultNotificationHolder notificationHolder
So I want add notifications from View2 for example.