The notification is used to display an informative message. It will normally be used as part of a notificationbox. The box includes a button which the user can use to close the box.
- Properties
- accessibleType, control, image, label, priority, persistence, type, value
- Methods
- close
Examples
<notification label="This is a warning"/>
Attributes
-
label
- Type: string
-
The label that will appear on the element. If this is left out, no text appears. For an editable
menuitem
element the value of this attribute is copied to themenulist
.value property upon user selection of themenuitem
.
-
persistence
- Type: integer
- The persistence may be set to a non-zero value so that the
notificationbox
'sremoveTransientNotifications
method does not remove them. This may be used to close a set of notifications as a group without affecting other notifications.
-
priority
- Type: integer
-
Numeric value that specifies the order in which the notifications appear. Should be one of the constants described in the
notificationbox
'sappendNotification
method.
type
- Type: one of the values below
- Indicates the type of notification, determined from the priority.
-
info
- a notification that is of lesser importance.
warning
- a normal warning notification.
critical
- a critical notification.
-
value
- Type: string
-
The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use. Be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) Use another attribute like "value2" or "data-myAtt" (as in the HTML5 draft), as XUL does not require validation (less future-proof); 2) Use setAttributeNS() to put custom attributes in a non-XUL namespace (serializable and future-proof); 3) Use setUserData() (future-proof and clean, but not easily serializable). For user editable
menulist
elements, the contents, as visible to the user, are read and set using the Menulist.value syntax. For those elements, setAttribute("value", myValue) and getAttribute("value") do not access or affect the contents displayed to the user.
Properties
-
accessibleType
- Type: integer
- A value indicating the type of accessibility object for the element.
-
persistence
- Type: integer
- Gets and sets the value of the
persistence
attribute.
-
value
- Type: string
-
Gets and sets the value of the
value
attribute. Fortextbox
and user editablemenulist
elements, the contents, as visible to the user, are read and set using theTextbox.value
and Menulist.value syntax.
Methods
close()
- Return type: no return value
- Closes the notification or findbar and removes it from its enclosing
notificationbox
orfindbar
.
Related
- Elements
-
notificationbox