Ist sehr später, aber gut, wenn Sie Vaadin Armaturenbrett verwenden Sie einfach die Datei common.css
.valo-menu .valo-menu-badge,
/*.dashboard-view */.notifications.unread .v-button-caption {
@include valo-badge-style;
position: absolute;
right: round($v-unit-size/3);
font-size: round($v-font-size * 0.9);
pointer-events: none;
}
/* .dashboard-view */.notifications.unread .v-button-caption {
display: block;
top: round($v-unit-size/-5);
right: round($v-unit-size/-5);
display: block;
z-index: 1;
}
ändern müssen, wenn es nicht zu Ihrem styles.css hinzufügen
immer kommentierten Codeblöcke entfernen (/ ** /)
Jetzt, in der Button:
b.addStyleName("notifications");
b.addStyleName("unread");
b.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
b.setCaption("7"); //any number, count, etc
Siehe Mitteilung sButton in DashboardView
Leider wird das Overlays-Addon für Vaadin 7 nicht unterstützt (https://vaadin.com/directory#!addon/overlays). Es würde Ihren Bedürfnissen entsprechen. –
Diese Benachrichtigung wird oft als "Badging" – petey