You are reading O'Reilly XForms Essentials by Micah Dubinko. (What is this?) - Buy XForms Essentials Online

Synopsis

This action directs a message to the user, with various possible levels of intrusiveness, based on the required attribute level. In scripting, this effect is commonly implemented with the alert( ) function, which is the most intrusive technique, since it is modal, and prevents any further action until the user dismisses the message. XForms enables friendlier (and less visual-centric) messages: modeless, which doesn't interfere with the rest of the form, but sticks around until dismissed; and ephemeral, a fleeting, goes-away-by-itself message, such as a tool tip or brief status bar message.

Figure 7.2, “XForms Action: message” shows visual representations of various messages.

The general concept of various levels of intrusiveness applies well to non-visual designs, too; for example, the difference between an insistent voice prompt that requires acknowledgement versus a one-time message.

Typically, the content of the message element is the message to be rendered. Like other XForms elements, the content can also come from the instance data (from binding attributes) or from an external file (from linking attributes). Only a single source is ever used; the order of preference is: binding attributes, linking attributes, inline text, as shown next.

<message level="ephemeral" ev:event="DOMFocusIn">Produced by PBP</message>
<message level="modeless" model="messages" ref="instructions/part3" 
                ev:event="xforms-help"/>
<message level="modal" src="important.html" ev:event="DOMActivate">