Now you will create the Web Interaction that will actually update the record on the iSeries. It will read the input fields from the custDispUpdateResults.jsp that you created in the previous exercise, pass the data in a structure as a parameter to the procedure doUpdate and display the new data in a Web page. In case of an error an error page gets displayed.
Generating another output page
To generate another output page:
The Select page opens.
Now you define the input and output pages. You use the page from the
previous exercise as the input page.
You let the Web Interaction wizard generate the output page.
This is the page your original Web Interaction generated; you are now linking it with another Web Interaction.
Now you will add a program.
Adding a program
To add a program:
You will see that the program has been added under Program call definitions.
Now you need to add the structure you defined earlier.
Adding a parameter
The procedure doUpdate is provided to you in WDSCSRV. It receives a structure with the input data from the Web page and updates the customer record. It returns the string 'ok' in the parameter forward if the update completed successfully.
To add a parameter:
The feedback from the procedure to indicate success is a 20 character parameter. You use this parameter to decide which page to show next.
Your wizard page should now look like this:
You can see the new parameters you have defined for this interaction.
The input parameter page opens.
To be able to generate the correct code, the Web Interaction wizard needs to know which field on the Web page is correlated to which parameter. You specify this correlation by linking the fields from the Web page to the correct parameter.
Now you will link the input page parameters.
You have just linked a field from the input page to the input parameter of your program.
Designing the output page
Now you design the output page.
To design the output page:
Now change the field labels to be readable.
CUSTNA | Customer Name |
REPNO | Representative Number |
CONTAC | Contact |
CPHONE | Phone Number |
CFAX | Fax Number |
CADDR | Address |
CCITY | City |
CCOUNT | Country |
CZIP | Zip |
Now, let's disable the values you don't want to be displayed.
As a final step, you choose not to use the CZIPLO field and not to display
the forward field.
You have generated another output page, added a program, added a parameter and designed the output page and now you are ready to begin Exercise 5.2: Adding the flow control error page.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.