25.3 Managing Legacy Tabular Forms

Create a legacy tabular form by running the Create Page Wizard and selecting Legacy Page and then Tabular Form.

Note:

A tabular form is a legacy application component. Although still supported, Oracle recommends developers create interactive grids instead.

A legacy tabular form enables users to update multiple rows in a table at once from a single page. When created using a wizard, a legacy tabular form enables you to perform update, insert, and delete operations on multiple rows in a database table. Tabular forms include a built-in multiple row update process that performs optimistic locking behind the scenes to maintain the data integrity.

25.3.1 About Creating Tabular Forms

Tabular forms created using wizards include automatic DML processes. These wizards create a form that performs update, insert, and delete operations on multiple rows in a database table. Alternatively, you can build a tabular form manually either by creating a updatable report region or standard report region with updatable columns with custom PL/SQL page processes to process the tabular form data.

Best Practices When Creating Tabular Forms

Oracle recommends the following best practices when creating tabular forms:

  • Do not modify of the select list of a SQL statement of a tabular form after it has been generated using a wizard. If you do modify the query, make sure the values of the updatable columns are not altered after being queried from the database by the Application Express engine.

  • Do not add custom JavaScript to display types that use display type specific JavaScript logic (for example, radio groups, simple check boxes, and popup key LOVs).

25.3.2 About Running a Tabular Form

When running a tabular form, data is rendered as a report having updatable columns shown using various form elements (including text fields, text areas, date pickers, select lists, radio groups, and so on).

By default, date columns are created using the Date Picker item type. If user interface defaults are defined, other columns can be automatically created as select lists based on lists of values, or numeric fields and large text areas.

For numeric and date fields, you can also pre-define date and number format masks, or apply those format masks after generating the initial form.

Each report also includes a check box column (called a row selector). Users use this row selector to select one or more columns and update or delete data. To add a row, users click Add Row.

Tip:

You can control the appearance of a specific column by editing column attributes.

See Also:

"Managing User Interface Defaults" in Oracle Application Express SQL Workshop Guide

25.3.3 How Tabular Forms Work

Tabular forms are based on a SQL query in which the query columns are tied to the underlying table columns. Unlike a single record from, tabular forms do not store data in session state. When a tabular form page is submitted, the tabular form data is processed using built-in data manipulation language (DML), or a custom PL/SQL page processes.

A tabular form with automatic DML has two processes for multi-row operations:

  • A Multi Row Update (MRU) process performs create and update operations.

  • Multi Row Delete (MRD) process deletes requests on one or more rows.

MRU and MRD processes reference the underlying table name and the primary key columns. The primary key columns must be part of the tabular form SQL query, and the report columns must be either hidden or display-only (save state) in order for the DML processes to be able to identify the correct records. For new records, the primary key values must be NULL to be identified as new records. Delete operations are performed by referencing row number of the row to be deleted. Users can check one or more rows on the current page and when they click the Delete button, the row numbers identify the corresponding primary key value(s) and the matching rows are deleted.

Wizard generated tabular forms built-in DMLinclude a checksum column to prevent lost updates. Using a method called optimistic locking, a checksum is computed for each row when rendering a tabular form. This checksum is stored in an extra hidden tabular form column. Upon submission of the form for update, an additional set of checksums is computed on the then current data stored in the database. The new checksums are compared to those built when the tabular form was first rendered, and if there are any mismatches, the update is rejected, because the data in the database was either modified by another user or anther process in the time between the tabular form was rendered and the time the data was submitted.

Wizard generated tabular forms also automatically create validations for some columns. Validations are created for columns that are set to NOT NULL in the underlying table and columns of type NUMBER, DATE or TIMESTAMP. Note that validations are not created for columns if the column is set to read-only, either based on the user's selection, or defined user interface defaults.

25.3.4 Creating a Legacy Tabular Form

Use the Create Page Wizard to add a legacy tabular form on a new page. Once you provide a table name on which to build the tabular form, the wizard reads the table columns from the database data dictionary. When creating a tabular form, Oracle recommends using a generic column template and avoiding column report templates.

Note:

Legacy tabular forms are legacy application components. Although Oracle still supports legacy components, Oracle recommends creating interactive grids instead.

To create a legacy tabular form using the Create Page Wizard:

  1. On the Workspace home page, click the App Builder icon.
  2. Select an application.
  3. Click Create Page.
  4. For Create a Page:
    1. User Interface - Select a user interface for the page (optional).
      This attribute only displays for applications using older themes and for which Desktop and Mobile User Interfaces have been defined.
    2. Page Type - Select Legacy Page and then Tabular Form.

      Tip:

      Component pages provides page-level functionality and can be added multiple times within a given application such as reports, forms, charts, or calendars. Feature pages provide application-level functionality and can only be added once per application.

  5. For Page Attributes:
    1. Page Number - If you identify a new page number, the wizard creates a new page. If you identify an existing page number, the wizard adds the component to that page.
    2. Page Name - Specify a name for the page.
    3. Page Mode - Identify the page mode. Options include:
      • Normal - The page is presented as a normal Application Express application page.

      • Modal Dialog - The page is presented as a modal dialog. A modal dialog is an overlay window positioned within the viewport, which remains active and focused until the end user dismisses (closes) it. The underlying page is grayed out and the end user is prevented from interacting with the rest of the page until the dialog is closed.

    4. Breadcrumb - Select whether you want to use a breadcrumb navigation control on your page. If you elect to include breadcrumb navigation, additional attributes appear.
    5. Click Next.
  6. For Navigation Preference:
    1. Select how you want this page integrated into the Navigation Menu. To learn more, see field-level Help.
    2. Click Next.
  7. For Tabular Form Source:
    1. Table/View Owner - Select the owner of the table on which you are building a report.
    2. Table/View Name - Select the table or view on which the form will be based.
    3. Select Columns - Select one or more columns to be included in the tabular form. In the pages that follow you define which columns should be updatable.
    4. Click Create.