Setting up Form Data
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.
Which part do I use?
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.
How do I use HTML page bookmarks?
When processing a form request, you can return to a specific portion of an HTML page by creating a bookmark as follows:
1. Add an anchor to the HTML page using a literal text field. For example:
<A Name=Anchor1>
2. Specify an anchor for the target URL in the #action attribute of the HTML form data..
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.
Example: Adding Form Data to the To-do List
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:
1. Select Form Data from the Parts Palette. Place the part in an empty area of the free-form surface.
2. Open the settings of the Form Data part.
3. For the pagePart property, specify MyWebSampleToDoList. This indicates that the MyWebSampleToDoList part contains the form that will be used to access this page.
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.
4. After you close the settings, look at the connection menu of the Form Data part. You should see an attribute for each of the fields you added to the Form.
Last modified date: 06/25/2018