A NotificationBar is a "toolbar" that can be added to a page to show
messages and notifications from the application. Its position, height
and width is (since 1.13.0) per default at the bottom of the
corresponding page. If the NotificationBar should be smaller than per
default a separate CSS-class must be added to the NotificationBar - as
seen in Example1.
IMPORTANT: to display the
bar an attached listener is mandatory! Otherwise the bar won't be
visible at all since the bar doesn't set its display-mode itself.
Resizing of the bar can be enabled or disabled. If the bar was maximized all messages are listed among each other with a scroll bar if needed.
Since version 1.19.0 it is possible to mark single messages as read-only. A corresponding example can be found under example 4. Furthermore NO selected event is fired for read-only messages. Please note that all messages are treated as selectable ones per default.
Detailed information of properties etc. can be found in the API documentation
Messages can contain a specific icon. It is recommended to use an icon that doesn't exceed 32 pixels.
If a message-level was set a default icon is used. It is also possible to use another icon instead.
To show any messages or notifications a so called Notifier must be
added to the bar that should be responsible for one kind of messages
or notifications. This Notifier handles all corresponding messages and
interacts with the bar to display them. The lastes message within a
Notifier is shown on top. The bar differs in two kinds of Notifiers: a
normal Notifier that monitors something for the application (i.e. new
Feed-items) and the MessageNotifer.
A MessageNotifier is
responsible to show messages with a message level. These levels could
be information, warning or an error. There can be messages without any
level as well - that's up to the application. The latest message that
was added to the MessageNotifier is shown within the message area of
the MessageNotifier (just aside the MessageNotifier). There is only
one possible MessageNotifier at a time. Setting another one will
overwrite the current one.
In version 1.8.5 the
color-handling of the MessageNotifier was changed. Before this the
color of the message counter was always red. From this version the
colors change corresponding to the message levels. If there are
several messages within the MessageNotifier the message with the
highest level defines the color. The following table shows the levels
from highest to lowest:
As default a Notifier shows up to 5 messages. If a Notifiers contains more than that a scroll bar is provided.
A Notifier can contain an icon as desired. If there is no specific icon set a default icon will be used. It is recommended to use an icon that doesn't exceed 24 pixels.
To react on any selectesd item a corresponding listener must be attached to the Notifier.
For detailed information please see the Notifier's API documentation
This example shows a bar with one Notifier with one single message. The Notifier uses a default icon. Resizing of the NotificationBar is disabled. Additionally this NotificationBar is a bit smaller than per default.
This example shows a bar with two Notifiers with several messages. Some messages contain icons. One Notifier uses another icon. Resizing of the NotificationBar is enabled.
This example shows a bar with two Notifiers and a MessageNotifier with several messages. Some messages contain icons. Some messages of the MessageNotifer contain a message level with the corresponding default icon. One Notifier uses another icon. Resizing of the NotificationBar is enabled. There is a listener that is attached to any clicks on a message.
The sample code removes one message (the last one) each time the bar is hidden. When it is displayed again, the message counter is adapted to the current number of messages and its color is chosen according to the highest priority of all messages.
This example shows how to use the new feature of read-only messages.