8.1 Introduction

We conclude our description of the XForms architecture and its inner workings with a description of the events and event flow that define the XForms processing model. The normative definition of this processing model is given in the XForms Processing Model (XPM [1] ); that description has been written explicitly with implementors in mind to ensure interoperability.

[1] http://www.w3.org/tr/xforms/slice4.html

The purpose of this chapter is to give a gentle introduction to the XForms processing model with a view to helping authors understand how they can leverage the XForms functionality in their own Web applications. To this end, we will cover only those aspects of the processing model that are most likely to be accessed by Web authors and point the XForms implementor and other interested readers to the XForms specification for the precise details.

XForms markup and the processing that is applied to that markup have both been designed to be hosted within a variety of Web containers . We have used XHTML as the host markup language for many of the examples in this book. This aspect of hosting XForms markup describes only the syntax of XForms contained within XHTML documents. The behavior of such XHTML documents that host XForms constructs is defined by the model given in the standard DOM Level 2 Events specification and exposed to the XML author by module XML Events (see Section 2.3). Thus, to complete the picture regarding the behavior of XForms constructs hosted in a DOM2-compliant XHTML container, all that remains is a description of how these various XForms constructs interact with the DOM2 events flow implemented by standard XHTML-aware Web browsers.

Thus, the description of the XForms Processing Model reduces to enumerating the following aspects of eventing in the context of XForms constructs:


Define the various XForms-specific events that can be raised


Specify at what points in the XForms processing model these events are raised


Specify where these events are targeted


Define the various actors responsible for handling these events


Specify how these actors handle these events

We will organize the rest of this chapter by grouping XForms events based on when and how they are raised. Using this classification, XForms events can be grouped into the following classes:


Events raised as the various XForms components are initialized as an XForms document is being loaded (see Section 8.2). These initialization events are of interest mostly to XForms implementors. Some advanced XForms applications might find it useful to hook special behavior by attaching custom handlers to these events.


Events raised by user interaction (see Section 8.3). These events are raised by user interaction gestures , for example, a request for help, and will be of interest to XForms authors when creating rich user interaction.


Events raised by the XForms processing model to trigger different steps in XForms processing (see Section 8.4). Events in this class are of interest to XForms authors when attaching custom behavior at specific points in the XForms processing model.


Notifications raised when specific types of error conditions are encountered . Events in this class are of interest mostly to implementors and are enumerated following for completeness.


Fatal error in evaluating a binding expression


Fatal error traversing a link


Recoverable error while traversing a link


Fatal error in a computation

XForms. XML Powered Web Forms with CD
XForms. XML Powered Web Forms with CD
Year: 2003
Pages: 94

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net