About page navigation

One of the major tasks when creating a set of Web pages is managing how one page links to another and how data is passed from one page to the next.

Navigation styles

You can link from one page to another using any of three navigation styles:

All three styles let you bind parameters to target pages, but the level of support for binding varies. Which navigation style you choose depends on how you want data passed, whether or not the data requires processing by the server, and the flexibility you need. Most 4GL Web pages navigate to other pages by server redirection, which provides the most flexible way to navigate from one page to another. Server redirection can also be used to navigate from non-4GL pages, but more coding is required. Table 10-1 next shows the advantages and disadvantages of the three navigation styles.

Table 10-1: Navigation style advantages and disadvantages

Navigation

Advantages

Disadvantages

Hyperlink

  • Jumps directly to another page without server processing

  • Works well with a range of different target pages when processing is unnecessary before moving to the target page

  • Allows non-matching names for parameter binding (binding defined in HREF attribute in page source)

  • Requires the values of parameters to be available when the page is generated.

  • Does not return to the server to process current page before moving to the next page. (Not all parameters and variables are available to the target page.)

  • Does not support server actions.

  • Does not support validation before navigation.

  • Does not allow the user to recover from errors caused by entering data in an invalid format.

Form submit

  • Jumps directly to another page without server processing

  • Requires the target page to define parameter names to match the parameters passed.

  • Provides only the data from the fields on the page form.

  • Does not support validation before navigation.

Server redirect

  • Supports validation and server actions

  • Processes the values of parameters before passing them to a target page

  • Allows non-matching names for parameter binding (binding defined in server script)

  • Retains the values of parameters and makes all the data available for parameter binding

  • Lets you redirect the client to another page from the middle of a server script

  • Lets you stop navigation if validation fails

  • Loads a current page, then the target page in the user’s browser (making this method slower than the other two styles).

  • Does not allow you to add FORM elements to a 4GL Web page. (A FORM represents an entire 4GL Web page.) You can still insert form field controls, but they are not surrounded by FORM tags in Source view.

Target pages

When you develop Web pages, you can specify a target page that already exists, or one that you plan to create. If you specify a page that already exists, you can bind values from the linking page to the parameters of the target page. If you specify a page that does not yet exist, you can set parameters on the linking page; then, when you create the target page, you specify which parameters it requires of those being passed from the linking page. For more information about page parameters, see “Setting up page parameters”.

Parameter binding

When you establish navigation from one page to another, you can bind values from the linking page to parameters on the target page. 4GL Web pages support several types of parameter bindings:

Table 10-2: Parameter binding for 4GL Web pages

Type of binding

Description

Navigation style restrictions

Constant

A fixed value

Not available for form submit.

Page Variable

A variable whose value is set on the server

Only initial value used by hyperlink (cannot be changed by client). Variable name must match parameter name on target page for form submit.

Page Parameter

A parameter whose value is set on the server

Only initial value used by hyperlink (cannot be changed by client). Parameter name must match parameter name on target page for form submit.

Expression

The value of an expression set on the server

Not available for form submit.

Control

The value property of a server object

Not available for hyperlink.

The user interface for binding parameters is different for each navigation style:

Table 10-3: Information about navigation style and parameter binding

Navigation style

For information, see

Hyperlink

“Managing client hyperlinks”

Form submit

“Managing client form submission”

Server redirect

“Managing server redirection”