However, all this comes at a price; user interaction that depends heavily on scripting becomes difficult to deploy on a variety of different devices and environments. In addition, HTML pages that rely heavily on scripting are hard to maintain. XForms 1.0 attempts to minimize the need for scripting by creating declarative XML event handlers that cover common use cases. The realization is that scripting will always be a convenient means for innovating on the Web; XForms codifies those scripting innovations that have survived the test of time on the Web to prove truly useful into a set of declarative handlers that can be implemented reliably on a variety of platforms.
We have encountered some XForms actions in earlier examples, for example, when creating add, delete, and scroll controls within the shopping cart and task list examples in Figure 4.13 and Figure 4.23. The rest of this chapter defines the various XForms actions along with examples as appropriate.
XForms action handlers are designed to be used in conjunction with XML Events described in Section 2.3. The XForms processing model is defined declaratively in terms of events and actions. Toward this end, XForms 1.0 defines a standard set of events described in Chapter 8. These events, together with the actions defined in this chapter, give the XForms author complete access to the XForms processing model from within XML markup. A key consequence of this design is that authors can hook into the XForms processing model at a number of predetermined points to attach custom behavior via specified actions. Such custom behaviors extend the look and feel provided by XForms user interface controls in a consistent and predictable manner.
Like the user interface controls, XForms action handlers have been designed to capture high-level semantics of a given action and to leave the actual implementation to the run-time environment. The resulting design is significantly more accessible than earlier Web technologies that relied exclusively on scripting.