Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column

From the point of view of the user interface, most web applications can be thought of simply as CRUD (Create, Retrieve, Update & Delete) operations on documents. In the diagram below, the form is being used to initially display a Customer and Order and then to update them. If you think in REST terms, the form is a View Resource that composes multiple Entity Resources (in this case a Customer Resource and an Order Resource), displays their current state and allows you to update them.

provides a very flexible and powerful mechanism for interacting with documents (and the web in general). You can download source code and forms for the discussion below. We strongly recommend that you download the example, study it and use it as a template for integrating with your own web applications.

Column
width240px

On this page:

Table of Contents
maxLevel1

 

...

That's it. As usual, you access the form using its URl. When the form is used (instantiated), you may specify one or more query parameters along with the URI. For this example, we might use a URI and query parameter: .../form/1234?customer=02.  will resolve the URI template above to: .../customers/02, GET the customer, and display the initialized form. When the form is submitted,  will automatically PUT the customer document to the same URI thereby updating the customer. The diagram below shows the interactions.

Here's an example form that uses the Customer entity described above. In the example:

...

...

Creating a new document

Consider the case where a form is used to create a new customer. Follow the same steps above, except use the appropriate URI template .../customers and change the Read method to POST. That's it. As usual, you access the form using its URl . When the form is used (instantiated),  will perform the POST and create the customer. It will then follow the server redirect (to the URI of the newly customer) and display the form. When the user enters customer information and submits the form,  will automatically PUT the resulting XML document to the URI of the newly created customer resource thereby updating it. The diagram below shows the interactions:

Here is an example form an example form that creates a new customer using this method.

Dynamic documents

A document URI template can also be linked to a form control. To do this, use the Control Name. Consider the Updating a document example above and the sample form therein.

...