15.4. <rich:notify>

The <rich:notify> component serves for advanced user interaction, using notification boxes to give the user instant feedback on what's happening within the application. Each time this component is rendered, a floating notification box is displayed in the selected corner of the browser screen.

15.4.1. Basic usage

The <rich:notify> has two message customization attributes: summary is short text summarizing the message, while detail configures the detailed body of the message. Both attributes have their counterparts in form of facets with the same names as the corresponding attributes.

15.4.2. Customizing notifications

A notification appears on the page each time it is rendered, either on full-page or ajax requests. The notification remains on the screen for 8 seconds and then disappears. Users can close the notification with the close button in the top-right corner of the notification.
Notification stacks can be used to create sequences. For customization of stacking see the <rich:notifyStack> component.
There are several attributes that can change default behavior:
  • sticky: notifications does not disappear automatically, they needs to be closed explicitly with close button (this attribute can't be used together with nonblocking and stayTime)
  • stayTime: configures how long notification stays on the screen before it disappears (in miliseconds)
  • styleClass: defines the class customizing the notification
  • nonblocking: defines notifications which becomes partially transparent and user can click through. Non-blocking notifications don't have close button.
  • nonblockingOpacity: defines opacity of nonblocking notifications when mouse hovers over notification (decimal number between 0 and 1)
  • showShadow: defines whether shadow will be displayed under the notification

Note

Nonblocking notifications can be clicked through, but because they are using jQuery mechanism to bypass events, only jQuery event handlers are triggered. IThis means that standard links won't be triggered.

15.4.3. Reference data

  • component-type: org.richfaces.Notify
  • component-class: org.richfaces.component.UINotify
  • component-family: org.richfaces.Notify
  • renderer-type: org.richfaces.NotifyRenderer

15.4.4. Style classes and skin parameters

Note that skinning is common for <rich:notify>, <rich:notifyMessage> and <rich:notifyMessages>

Table 15.3. Style classes (selectors) and corresponding skin parameters

Class (selector) Skin Parameters Mapped CSS properties
.rf-ntf
This class defines styles for notification
No skin parameters.
.rf-ntf-shdw
This class defines style of the shadow under notification box.
headerBackgroundColor
background-color
headerTextColor
color
.rf-ntf-cnt
This class defines style of the content of notification box.
panelBorderColor
border-color
generalBackgroundColor
background-color
panelTextColor
color
.rf-ntf-ico
This class defines style for notification icon.
No skin parameters.
.rf-ntf-sum
This class defines style for notification message summary.
No skin parameters.
.rf-ntf-det
This class defines style for notification message detail.
No skin parameters.
.rf-ntf-cls
This class defines style for element wrapping close button.
No skin parameters.
.rf-ntf-cls-ico
This class defines style for close button icon.
No skin parameters.