When you build a page that processes input from a previous page, you must include a Form Data part. Add the part to any empty area of the free-form surface. Then open the settings of the part and specify the name of the Web Connection part containing the form that generates requests for this page.
In a typical Web application, users move through a series of pages one after the other. Each page depends upon the data from the previous page. Therefore, in the settings for Form Data, you should specify whichever page is the "previous" page in your application design.
In some cases, a simple Web application might consist of a single page that is loaded over and over, processing new input each time. In this situation, you would configure Form Data to point to the same Web Connection it is contained in. But this is an unusual case: in effect, the previous page is the same page.
When processing a form request, you can return to a specific portion of an HTML page by creating a bookmark as follows:
<A Name=Anchor1>
When you serve the page specfiied by the form #action, the browser points to the specified anchor, Anchor1.
Note: | If the anchor does not exist in the document, the browser ignores the anchor name in the URL. Therefore, if you have a router web part that returns different pages based on user input, the browser points to the anchor only on those pages where the anchor exists. If the anchor does not exist, an error does not occur. |
The To-do List example (MyWebSampleToDoList) uses a Form Data part to process the data submitted by the user adding or removing items from the list. This data includes the items typed in the entry field, items selected in the list, and buttons clicked in the interface. (If you have not yet built the user interface for the To-do List example, see Example: Building the To-do List interface.)
To set up Form Data to process user input in the To-do List, follow these steps:
Note: | This sample application consists of a single window that is reloaded each time a change is made. In an application with multiple windows, the Form Data part would normally use a different page to define its attributes. |