You declare a pageHandler
part in an EGL file, which is described in EGL projects, packages, and
files. This part is a generatable part, which means that it must be at
the top level of the file and must have the same name as the file.
An example of a pageHandler part is as follows:
// Page designer requires that all pageHandlers
// be in a package named "pagehandlers".
package pagehandlers ;
PageHandler ListCustomers
{onPageLoadFunction="onPageLoad"}
// Library for customer table access
use CustomerLib3;
// List of customers
customerList Customer[] {maxSize=100};
Function onPageLoad()
// Starting key to retrieve customers
startkey CustomerId;
// Result from library call
status int;
// Retrieve up to 100 customer records
startKey = 0;
CustomerLib3.getCustomersByCustomerId(startKey,
customerList, status);
if ( status != 0 && status != 100 )
setError("Retrieval of Customers Failed.");
end
end
Function returnToIntroductionClicked()
forward to "Introduction";
end
End
The diagram of a pageHandler part is as follows:
- PageHandler pageHandlerPartName ... end
- Identifies the part as a PageHandler and specifies the part name. For
the rules of naming, see Naming conventions.
- pageHandlerProperty
- A PageHandler part property, as listed in PageHandler part properties.
- use dataTablePartName, use libraryPartName
- A use declaration that simplifies access of a data table or library. For
details, see Use declaration.
- private
- Indicates that the variable, constant, or function is unavailable to the
JSP that renders the Web page. If you omit the term private,
you can bind the variable, constant, or function to a control on the Web page.
- dataItemName
- Name of a data item (a variable). For rules, see Naming conventions.
- primitiveType
- The primitive type assigned to the data item.
- length
- The structure item's length, which is an integer. The value of a memory
area that is based on the structure item includes the specified number of
characters or digits.
- decimals
- For a numeric type (BIN, DECIMAL, NUM, NUMC, or PACF), you may specify decimals,
which is an integer that represents the number of places after the decimal
point. The maximum number of decimal positions is the smaller of two numbers:
18 or the number of digits declared as length. The
decimal point is not stored with the data.
- dataItemPartName
- The name of a dataItem part that is a model of format for the data item,
as described in typeDef. The dataItem part must be visible to the pageHandler
part, as described in References to parts.
- itemProperty
- An item property. For details, see Page item properties.
- recordName
- Name of a record (a variable). For rules, see Naming conventions.
- recordPartName
- The name of a record part that is a model of format for the record, as
described in typeDef. The record part must be visible to the pageHandler
part, as described in References to parts.
- recordProperty
- An override of a record property. For details on the record properties,
see one of the following descriptions, depending on the type of record in recordPartName:
- itemName
- Name of the record item whose properties you intend to override.
- itemProperty
- An override of an item property. For details, see Overview of EGL properties
and overrides.
- constantName literal
- Name and value of a constant. For rules, see Naming conventions.
- arrayName
- Name of a dynamic or static array of records or data items. If you use
this option, the other symbols to the right (dataItemPartName, primitiveType,
and so on) refer to each element of the array.
- functionPart
- An embedded function. For details on the syntax, see Function part
in EGL source format.