In previous exercises, no parameters were required to invoke the Order Entry Application. The WebFacing Tool, however, also provides capabilities to pass parameters to the program at invocation. In this situation, you have two choices:
Use fixed parameter values.
At run time, ask the user for parameter input on the index.html Web page.
If you have constants to pass, you would just specify the parameter as you do on a 5250 command line.
The ORDENTRPAR program accepts one parameter. In this exercise, you add a program invocation with one parameter to the index.html page.
In the WebFacing Project view,
Expand the wflabxx project.
Right-click the CL commands node.
Select the Add option from the pop-up menu.
The Specify CL commands dialog appears (Figure 20.1).
Enter the following CL command: CALL ORDENTRPAR PARM('0006') .
Enter the following command label: Order Entry Application with fixed parameter.
Specify your user authentication information.
Click the Finish push button.
Run the application.
Select the new link in the browser.
Note that in Figure 20.2 the Customer number field is now prefilled with the parameter value you specified in the invocation command.
You will use the same ORDENTRPAR program as before, but now instead of providing a fixed value, you will have the user specify a value on the index.html page.
In the WebFacing Project view,
Expand the wflabxx project.
Right-click the CL commands node.
Select the Add option from the pop-up menu.
The Specify CL commands dialog appears (Figure 20.3).
Enter the following CL command: CALL ORDENTRPAR PARM('&CUSTNO').
Enter the following command label: Order Entry Application with dynamic parameter input.
Specify your user authentication information.
Click the Finish push button.
Run the application.
Note the &CUSTNO entry field on the index.html page (Figure 20.4).
Tip | You can improve the field heading text by editing the index.html file. |
Enter a valid customer number in the &CUSTNO entry field.
Select the new link in the browser.
Note that in Figure 20.5 the Customer number field is now prefilled with the parameter value you entered on the index.html page.