Application Express User's Guide > Using Application Builder > Understanding Application C... > About Application Computations
About Application Computations |
Previous |
Next |
A common use of an application item is to store the value of the last page viewed in the application. By storing the value in an item, you can add a back button and then redirect the user to the page ID captured by the computation. This type of computation works well, for example, when you need to enable users to back out of an error page.
The following is an example of a computation that stores the last page visited. In this example, the computation:
Stores the last application page visited to an item named LAST_PAGE
Checks that the value of a CURRENT_PAGE_ITEM
is of type PL/SQL Function Body with a Computation body of:
BEGIN :LAST_PAGE := nvl(:CURRENT_PAGE,:APP_PAGE_ID); :CURRENT_PAGE := :APP_PAGE_ID; RETURN :LAST_PAGE; END;
Typically an application computation runs at the same point across multiple pages in an application. The exception is computations having a Computation Point of On New Instance. This type of computation only runs when a user first accesses your application. This type of computation is useful when you need to only retrieve information once within a user's session (for example, to retrieve a user's job title).