Passing Parameters in an Invocation Command


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:

  1. Use fixed parameter values.

  2. 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.

Using a Fixed Parameter Value

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).

click to expand
Figure 20.1: Adding a program invocation with one parameter to index.html page
  • 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.

click to expand
Figure 20.2: Customer number field prefilled by value of fixed parameter

Using a Dynamic Parameter Value

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).

click to expand
Figure 20.3: Adding a program invocation with one parameter to index.html page
  • 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).

click to expand
Figure 20.4: The index.html page with a parameter input field
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.

click to expand
Figure 20.5: Customer number field prefilled with input value from the index.html page



Understanding the IBM WebFacing Tool. A Guided Tour
Understanding the IBM WebFacing Tool: A Guided Tour (IBM Illustrated Guide series)
ISBN: 1931182094
EAN: 2147483647
Year: 2003
Pages: 153

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net