Alert behavior

Display an alert message or a confirm message in response to a button click. If a confirm is displayed, the answer to the confirmation question determines if the event is stopped or not (i.e., if the click is processed or not.
Note: Deprecated. This behavior is superseded by JSFBehaviorGeneric since JWL 2.1.

The Alert behavior displays an alert or confirm message box. If an alert is displayed, processing is stopped after the box is dismissed. If a confirm is displayed, processing is stopped if the user chooses "Cancel" (or "No").

Base HTML

<input type="submit" >

<input type="reset" >

<input type="button" >

<input type="image" >

JavaScriptâ„¢ constructor

hX_5.addBehavior("id", "onclick", new hX_5.JSFBehaviorAlert(attributes)); where

id

The ID of the HTML tag to which the component is attached.

attributes

Comma separated list of attributes where each attribute is a quoted string consisting of the attribute name and value separated by a colon, for example "label:MyLabel".

Supported events

Event

Description

onclick

Use is private to the implementation of the <hx:panelActionbar>

Attributes

Table 1. Alert behavior attributes

Attribute name

Description

message

The message to display.

prompt-type

0 displays an alert message box. 1 displays a confirm message box.

Sequencing

Runs after any other handlers provided for the event.

Stops the event continuing/bubbling if action is alert, otherwise stops the event if the confirm is "No".

API calls

Table 2. Alert behavior API calls

API call

Description

object = setAttribute(attribute)

Sets an attribute or changes its value (if it was set previously).

string = getAttribute(attribute-name)

Retrieves the current value of an attribute.

Example code

When a button is clicked, confirm that a user wants to the submit to happen.

hX.addBehavior("form1:button1c", "onclick", new hX.JSFBehaviorAlert("message:Submit this page?","prompt-type:1" ));

Feedback