The Alert component enables the display of an alert message directly on the page. An alert message consists
of an icon depicting the type of alert (information, warning,
error, or success, or a user-defined type specified in the indicators property) and a summary message, plus an optional detail message.
This component is a JavaServer Faces 1.2 component. You see components that use this
version of JavaServer Faces when your project uses Java EE 5. For more information on JavaServer Faces 1.2,
see:
If the summary property is not defined, the Alert component will not be displayed.
After dragging the button to the Visual Designer, you can:
Begin typing the text of the summary message.
Select the button and edit its properties in the Alert's Properties window. Some typical properties you might set are:
id. The name of the component. In the JSP file, this name is the value of the component's id attribute. In the page bean, this property's value is the name of the Alert object.
summary. The short text message indicating what the alert is about.
detail. A longer text message providing more detail than the summary.
type. An Advanced property indicating the severity of the alert, which determines the icon that appears to the left of the summary. Choose an item from the property's drop down list and you can see the icon change in the Visual Designer.
Right-click the alert and choose one of several actions:
Edit action Event Handler. Code the action event handler, the method that is called when the user clicks a hyperlink that was added to the detail section by setting the urlText property in the Properties window. This method determines which page or resource to open based on specified conditions. The action method typically processes mouse clicks and returns a string indicating the name of a page navigation case (the page in your application to display next). The default name for the method is alert-id_action, where alert-id is the value of the Alert component's id property.
Bind to Data. Dynamically set the summary text. The text comes from the object or data provider you specify, such as a column of a database table. For more information, see Bind to Data Dialog Box.
Property Bindings. Opens a dialog box that enables you to bind properties of the component in addition to the summary property to other objects or bean properties that update this component's properties automatically.
Add Binding Attribute. This option adds a binding attribute to the component.
Note: If you plan to script the component in Java code, you must manually add a binding attribute, which is bound using a value binding expression to a property of the backing page bean.
Remove Binding Attribute. This option removes the binding attribute from the component.
Align. If you have multiple components selected, you can specify how they align with one another. If only the current component is selected, you can choose whether the component aligns with (snaps to) the background grid when you move it around.
Preview in Browser. See how the page renders in the default web browser for your system.