The first form that you will create for the FanClub application will look something like this:
This form enables end users to add a new fan to the data source.
The information typed into this form will be written to the fannames data source, so it should correspond to the fields in the data source. The fastest way to create the fields on the form is to use the existing data source fields. Therefore, your first task is to add data source fields to the form.
WebFOCUS Maintain opens the Select Segment Fields dialog box. You must specify which data source stack fields you want to display on your form. First, you need to understand the role of data source stacks in your project.
How to: |
WebFOCUS Maintain procedures do not display or manipulate information in a data source directly. Instead, they use data source stacks as intermediaries between end users and the data source.
A stack is a non-persistent (or in-memory) table where you can store and manipulate data from one or more data sources. WebFOCUS Maintain procedures use stacks to hold values you read from the data source and to manipulate data before writing it back to the data source.
Since this is a new procedure, there are no stacks yet. You are going to create one named AddFanStack, instead of using the default CustomerStk. The structure of the stack is based on the fields in the data source, in other words, the stack is going to have the columns SSN, LASTNAME, FIRSTNAME, and so on. However, this stack will be empty until you do something to put data in it.
WebFOCUS Maintain places all of the fields from the CUSTOMER segment except TITLE and USER into the form.
In the Project Explorer, there have been some additions to the components of Start:
In the Form Editor, you design the user data adapters for your applications. Take a look at its contents.
Note: The screen may look different from what you see here. The windows have been moved.
Following are the main components of the Form Editor:
How to: |
When you placed these fields on the form, WebFOCUS Maintain placed them in a column. This is not an optimal arrangement for the fields. Rearrange them so that Firstname and Lastname are next to each other in a row, and City, State, and Zip are also next to each other.
If the grid is on, when you move controls on your form, the Form Editor automatically snaps them to the closest grid point. This feature enables you to keep controls easily aligned on a form.
Since the grid is on, you preserve the correct vertical spacing between fields.
When you are done, your form looks something like this:
How to: |
While Firstname and Lastname are certainly descriptive field prompts, they are definitely not English words. Rename these two field prompts to "First" and "Last."
Notice that the control in the property sheet says (Group), indicating that the Firstname field is not a single control but is actually two controls grouped together. It is useful to group controls so that WebFOCUS Maintain treats them as a unit; this means that you cannot move one without moving the other.
Firstname is made up of two controls: a text box named Firstname_Text that serves as the prompt, and an edit box control named Firstname_Edit where the end user types a value for the Firstname field. Together they are called a prompted edit box.
You can then see the properties for Firstname_Text.
How to: |
If you have been moving these controls around in the window and renaming prompts, your fields have probably become misaligned. The Form Editor enables you to align controls easily.
One of the alignment tools is designed especially for aligning entry fields such as these, which are made up of a text control and an edit box control.
You can multi-select fields by selecting the first one and then holding down the Shift key or the Control key while you select the remaining fields.
Notice that one of the fields has green handles, while the other ones have blue handles. The field with green handles is the anchor control, that is, the field with which all the other fields are aligned.
or
In the Layout toolbar, click the Align Edges button.
Then click the Center vertically button in the pop-up toolbar.
Your entry fields should look like this:
WebFOCUS |