Setting up page and session variables

You create page and session variables for use in server scripts. The variables for a 4GL JSP page are available to all server scripts, including events and blocks of server scripts used to generate a section of a page. The Web Target user interface makes it easy to bind variables from a linking page to parameters from a target page.

For more information about page variables and session variables, see “Managing page data”. For information about passing parameters using different navigation styles, see “About page navigation”.

Variable properties

The value of a variable depends on the following:

Table 9-4: Properties of variables

Property

Value

Data Type (JSP targets only)

boolean, byte, char, double, float, int, long, short, String

Life Time

Page or session

Client Access

None, read only, or read/write

A read/write variable lets users set a value on a page in their browser. A server action for the page returns the client-entered value to the server.

Defining variables

When you define variables for a page, you can set the scope and the client access attributes for each variable.

StepsTo define page or session variables:

  1. Right-click in a 4GL JSP page open in the HTML editor, then select Page Properties from the pop-up menu.

  2. In the Page Properties dialog box, click the Variables tab.

  3. On the Variables page, click the New button, and then specify values for the variable.

    Shown is the Variables tab page of the Page Properties dialog box. It has columns for Variable Name, Initial Value  Life Time, Client Access, and Session Name that display the following sample entries: My Var 1 with page life time and Read / Write client access, page Var 1 with Initial Value 101, page life time, and Read Only client access, and See Var with Initial Value John, session life time, Client Access of NONE, and Session Name John Session.
  4. Repeat step 3 for each variable you want to define.

  5. Click Apply.