spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / programming / awxml3 / 1 To page 1To page 2To page 3To page 4current pageTo page 6
[previous] [next]

Subject Matter Expert - Managed Services (PA)
Next Step Systems
US-PA-Wayne

Justtechjobs.com Post A Job | Post A Resume
Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs


XForms: XML Powered Web Forms: Chapter 1

1.3.4 XForms Submit

The final stage of the questionnaire user interaction is to have the user submit the information. Using HTML forms, this is achieved by creating a submit button within HTML element ~form~. Activating the corresponding user interface control results in all values created as part of the containing ~form~ being submitted to the URI specified via attribute action.

As mentioned earlier, a key feature of XForms is to separate the model from the interaction. XForms preserves this separation in its design of data submission. Submission details covering

• What to submit,
• Where to submit,
• How to submit

that are independent of the presentation are encapsulated by element ~submission~ within element ~model~. XForms user interface control ~submit~ when activated dispatches an appropriate xforms-submit event to the relevant ~submission~ element. Upon receiving this event, the XForms processor serializes the values stored in the instance before transmitting the result as specified by element ~submission~.

For the questionnaire example, we first extend the model shown in Figure 1.2 with an appropriate ~submission~ element—see Figure 1.9.

Figure 1.9. Element ~submission~ models what, where, and how to submit.

User interface control ~submit~ in Figure 1.10 uses attribute submission to connect the user interface to the model. We show the resulting user interface in Figure 1.11.

Figure 1.10. XForms user interface control for submitting the questionnaire.



Figure 1.11. Visual representation of XForms submit control.

1.3.5 The Complete XForms Questionnaire

This section combines the model and user interface developed so far to create the complete XForms questionnaire. The resulting XForms application is contained in an XHTML document. The complete example uses XML namespaces so that markup elements defined by different XML languages such as XForms and XHTML are clearly identified—see Figure 1.12.

1.3.6 Deploying the XForms Questionnaire

The XForms questionnaire can be deployed in a variety of ways depending on the XForms processor being used. This section details a variety of deployment scenarios.

The questionnaire can be deployed on an XForms-aware Web server that provides the following:
Serve content The server produces a presentation that is appropriate for the connecting device.
Code generation The XForms server can generate client-side validation code to be embedded in the markup being served to the connecting client. This provides client-side validation and immediate user feedback, but without the cost of requiring the Web developer to hand-craft such validation scripts.

Figure 1.12. The complete XForms questionnaire.
Data Validation Validate user data against the constraints given in the model.
State management Maintain application state by implementing the XForms processing model. As a result, the developer of the questionnaire need write no special software for maintaining values submitted by the user between client-server round-trips.


The XHTML document hosting the XForms questionnaire could be served to conforming XForms clients. An XForms client would implement the following:
Consume Consume the XForms-authored application to produce the client-side user interface.
Validate Check user input against the validation rules to provide live feedback.
Submit Submit a valid XML instance on completion.

 

Notice that in the deployment scenarios, the Web developer need only create the XForms questionnaire; contrast this with the application-specific components needed when deploying HTML forms—compare Figure 1.1 with the software components needed to deploy the XForms questionnaire shown in Figure 1.13.

home / programming / awxml3 / 1 To page 1To page 2To page 3To page 4current pageTo page 6
[previous] [next]

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint

Created: March 27 2003
Revised: January 2, 2004

URL: http://webreference.com/programming/awxml3/