Use of an EGL program in a Web application

An EGL program can participate in a Web application in several ways:
Note: The VGWebTransaction program is provided primarily to support migration from VisualAge® Generator. It is recommended that you use PageHandlers for new development.

Programmatic control and the VGUI record

When you present a Web page by displaying a VGUI record from a VGWebTransaction program, you can ensure the following sequence:
  1. The user submits page data
  2. Processing continues with the next statement in the current program or with the first statement in a specified program

By repeatedly forcing the invocation of specific logic, you can cause a sequence of Web pages to be presented in the same browser window.

To ensure that a specific program is invoked after the user submits data from a Web page, the originating program uses one of two kinds of EGL statements to present the page:
  • The converse statement; or
  • The show statement with a returning clause.

Alternatively, to let the user rather than the program determine which program is invoked in response to a Web page, present the page with a show statement that has no returning clause.

However you create a Web application, you can include buttons and hypertext links to allow the user to display new Web pages in different (new) browser windows.

converse statement

The converse statement ensures that, after the user submits data, the next statement in the same program is invoked. Also, the variable values in the program (as stored in a work database) are the same as when the page was presented, with these exceptions:
  • Changes made to the VGUI record are in effect when the program regains control.
  • The values of some system variables are lost. For details on a specific variable, see the help page for that variable, as listed in System words in alphabetical order.

A program design that uses a converse statement is relatively simple; but if you are generating a Java™ program, you get better performance by using a show statement to return to the beginning of the same program. Use of a show statement requires a more complicated design, however, because the re-invoked program starts at the first line, and that initial code must analyze whether the program is being invoked at the beginning or in the middle of a user-code interaction.

For other details on the converse statement, see converse.

show statement

The show statement with a returning clause ensures that, after the user submits data, the program specified in the returning clause is invoked. You can code the statement so that the invoked program receives data directly from the originating program; in this way you can retain variable values for use at a later stage of the user-code interaction.

If you present a Web page by using a show statement without a returning clause, the Web page is presented without directing subsequent processing. In this case, you can include buttons and hypertext links to give the user a range of choices for what is displayed in the same (or a different) browser window.

For other details, see show.

Related concepts
VGUIRecord part

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.