This section describes how to manage page computations in Page Designer and in Component View. You can use page computations to assign a value to an identified item when a page is submitted or displayed. You can also use application-level computations to assign values to items. Most page-level computations populate page items. In contrast, most application-level computations populate application items.
Topics:
See Also:
A page computation assigns a value to an identified item when a page is displayed or submitted (rendered and processed).You create a page computation by running the Create Page Computation Wizard. For each computation, specify the item for which you are creating the computation and a computation type.
This section describes how to create page computations in Page Designer.
Tip:
Learn more about execution behavior in the case of a validation error.
Topics:
Once you create a computation, you can edit it on the Edit Page Computation page.
To edit a page computation:
See Also:
You control when a computation executes using the Execution Options, Sequence and Execution Options, Point attributes. The Sequence attribute determines the order of evaluation. The Point attribute determines the point in page rendering or processing at which the computation executes. The most typical computation point is After Submit. For example, selecting On New Instance executes the computation when a new session (or instance) is generated.
After you specify the Sequence and Point, enter an expression or query under Computation to compute an item's value. In the event a computation fails, you can optionally define an error message in the Error Message attribute.
Developers can create and edit page computations in Component View.
Tip:
To learn more about execution behavior in the case of a validation error, see "What Happens When a Validation Fails?"
Topics:
A page computation assigns a value to an identified item when a page is displayed or submitted (rendered and processed).You create a page computation by running the Create Page Computation Wizard. For each computation, specify the item for which you are creating the computation and select a computation type.
To create a page computation:
Once you create a computation, you can edit it on the Edit Page Computation page.
To edit a page computation:
You control when a computation executes using the Sequence and Computation Point attributes on the Edit Page Computation page. The Sequence attribute determines the order of evaluation. The Computation Point attribute enables you to specify the point at which to execute the computation the item. For example, selecting On New Instance executes the computation when a new session (or instance) is generated.
After you specify the Sequence and Computation Point, under Source, enter an expression or query in the Computation field to compute an item's value. In the event a computation fails, you can optionally define an error message in the Computation Error Message field.
A good example of using computations can be illustrated by a page containing form fields for entering phone numbers. In this example, the phone number is stored in one database column; however, the data entry form breaks the phone number into three components: area code, prefix, and line number. In this example, the page items are called P10_AREA_CODE
, P10_PREFIX
, and P10_LINE_NUMBER
.
Next, suppose you need to combine the values stored in these items into a single string. You could accomplish this by using an After Submit computation and store the combined values in an item called P10_PHONE_NUMBER
.
To create a computation to store the combined values of P10_AREA_CODE
, P10_PREFIX
, and P10_LINE_NUMBER
in new items:
P10_PHONE_NUMBER
to store the combined values of P10_AREA_CODE
, P10_PREFIX
, and P10_LINE_NUMBER
.