HomeOracle Page 3 - Data Manipulation and More for HTML DB Applications
Form Pagination - Oracle
In this conclusion to a three-part series covering the addition of validations, computations, and processes to an HTML DB application, you will learn about data manipulation, manually creating a web services process, and more. This article is excerpted from chapter 13 of the Oracle HTML DB Handbook, written by Lawrence Linnemeyer and Bradley Brown (McGraw-Hill, 2006; ISBN: 0072257687).
The Form Pagination process is used with a master detail page. It determines the next and previous master records and populates a field to display the positional count of the current master record (for example, “3 of 4”). This particular type of process is created when you use the wizard to create a master detail form.
Most of the time when your application uses one of these type processes, it is created by the Master Detail Wizard. However, if you understand what the process does, you may find a time when you want to create a process of this type manually. For instance, you could use a Form Pagination process on a page that displays a single record from a table and the process would handle the next-record and previous-record navigation for that table.
The process operates on a single table and should usually be defined to be evaluated after the header when the page is being rendered. The process takes the current primary key and determines, based on a specified sort order, the primary keys of the records that are logically before and after the current record.
You must already have an item on your page where the primary key of the table will be stored. Creating a Form Pagination process not only produces the process but also creates the following:
A hidden field to hold the value of the primary key for the next master record
A hidden field to hold the value of the primary key for the previous master record
A Previous button with conditions to display only if there is a value in the previous primary key hidden field
A Next button with conditions to display only if there is a value in the next primary key hidden field
A display field for the current master record count (for example, “3 of 4”)
A branch back to the same page, conditional on the Next button, that populates the item holding the primary key with the value from the item holding the primary key of the next record
A branch back to the same page, conditional on the Previous button, that populates the item holding the primary key with the value from the item holding the primary key of the previous record
If you are manually using this processes, you would have a query whose WHERE clause references the item containing the primary key.
This explanation always refers to a single primary key on the table. However, the wizard and process can handle a primary key with two columns. In that case, the wizard would create two “next” and two “previous” hidden fields.
In the Create Page Process Wizard, after selecting the Form Pagination type process, you specify the table on which to base the process. Next, you specify the one or two columns that make up the primary key on the table and the existing page items where these keys will be. These items are the only ones that must exist prior to creating the process. Then, you must specify the region on your page where the wizard should create all the items specified previously. You will also specify one or two columns from the table that will be used to determine the ordering of the table. If you do not specify a column for ordering, the order will be determined by the primary key. Finally, you can specify a WHERE clause if you want to limit the records that will be included.