10.4 Managing Master Detail Forms

Developers can create a master detail form with either the Create Application Wizard or the Create Page Wizard.

Tip:

To see a working examples of one page and two page master detail forms, install the sample application, Sample Projects and view the Projects page. See "Installing a Packaged Application."

10.4.1 About Master Detail Forms

A master detail form reflects a one-to-many relationship between two tables in a database. Typically, a master detail form displays a master row and multiple detail rows. When you create a master detail form using the Create Page or Create Application Wizards, you choose the tables on which to build the master form and the detail form.

Single Page Master Detail

A single page master detail features two editable interactive grids based on two related tables or views. Users select a row in the master grid to update the detail grid. Developers can create a single page master detail with either the Create Application Wizard or the Create Page Wizard.

A single page master detail features two editable interactive grids based on two related tables or views.

Description of GUID-4387D49C-3C96-46A5-B5FD-DF7B54EC239A-default.png follows
Description of the illustration GUID-4387D49C-3C96-46A5-B5FD-DF7B54EC239A-default.png

Users select a row on the master grid to update the detail grid. In this example, when the user selects a department on the master grid to view employees in the detail grid. Developers can create a single page master detail with either the Create Application Wizard or the Create Page Wizard

Description of GUID-A6F40D9F-53EC-4E2D-8C19-6D97DFBE8BBF-default.png follows
Description of the illustration GUID-A6F40D9F-53EC-4E2D-8C19-6D97DFBE8BBF-default.png

Two Page Master Detail

A two page master detail features two pages based on two related tables or views. The first page is a non-editable interactive grid. Users click the Edit icon on the first page edit details on the second page.

In this example, users click the Edit icon to access all employees within a department. The second page includes both a standard form (for the master) and editable interactive grid of employees.

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. Wizard generated master detail 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.

Tip:

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

10.4.2 Creating a Single Page Master Detail Using the Create Application Wizard

When you create a master detail form using the Create Application Wizard, the wizard creates single page with two editable interactive grids based on two related tables or views. With this page, users can query, insert, update, and delete values from two tables or views which are related.

Tip:

The Create Application Wizard uses general best practices to generate the application and does not include several advanced options included in the Create Page Wizard.

To create a master detail form using the Create Application Wizard:

  1. On the Workspace home page, click the App Builder icon.
  2. Click the Create button.
  3. Click New Application.
  4. For Name, enter the name used to identify the application to developers.
  5. For Appearance, accept the default Theme Style and menu layout (Vita, Side Menu), or change it by clicking the Set Appearance icon adjacent to the Appearance field.
  6. To add a report, click Add Page and select then select Master Detail.
  7. On Create Form Page:
    1. Page Name - Enter a name for this page.
    2. Set Icon - Select an icon to display in the navigation menu for this page.
    3. Page Type - Select either Master Detail or Editable Grid.

      If Page Type is Master Detail:

      • Table - Select the master table for the page.

      • Primary Display Column - Select the column to display in the list of master records.

      • Secondary Display Column - Select the descriptive column to display in the list of master records, under the Primary Display Column.

      • Detail Table 1 - Select the first detail table for the page.

      • Detail Table 2 - Select the second detail table for the page.

      • Detail Table 3 - Select the third detail table for the page.

      • Detail Table 4 - Select the forth detail table for the page.

      If Page Type is Editable Grid:

      • Table - Select the master table for the editable interactive grid.

      • Detail Table - Select the detail table for the page.

      Tip:

      You can only add one detail table (editable interactive grid) can be added using this wizard. Add additional detail tables can easily be added post-generation using the Create Page Wizard..

    4. Advanced - Expand Advanced:
      • Page Help - Enter text to be displayed when the user selects Page Help.

        Tip:

        This setting requires you select the Help Pages feature. If the Help Pages feature is not selected, the Help icon is not be generated and end users cannot access page help.

    5. Click Add Page.
  8. Under Features, select features to include with the application. Features provide application-level functionality and are typically added once per application. To learn more, click the Help icon adjacent to Features.

    Tip:

    Click the Check All button to select all features.

  9. Under Settings, specify settings used to generate this application. To learn more about an attribute, click the Help icon adjacent to Settings.
  10. Click Create Application.
  11. To view the new master detail page, click Run Page.
    The rendered page appears.

10.4.3 Creating a Single Page Master Detail Using the Create Page Wizard

Using the Create Page Wizard, you can create either a Single Page Master Detail. A Single Page Master Detail features two editable interactive grids based on two related tables or views.

To create a single page master detail using the Create Page Wizard:

  1. Navigate to the application, or create a new application.
  2. On the Workspace home page, click the App Builder icon.
  3. Select an application.
  4. Click Create Page.
  5. For Create a Page:
    1. User Interface - Select a user interface for the page.
      This attribute only displays for applications using older themes for which Desktop and Mobile User Interfaces have been defined.
    2. Page Type - Select Component and then 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.

  6. On Create Page, select Single Page Master Detail.
  7. On Page Attributes:
    1. Page Number - Enter the page number of the master page. 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 - Enter the name of 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.
  8. 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.
  9. For Master Source:
    1. Master Region Title - Enter a region title for the master region.
    2. Table/View Owner - Select the owner of the table on which you are building an interactive grid.
    3. Table / View Name - Select the table or view on which the grid will be based.
    4. Primary Key Column - Select the name of the column that uniquely identifies a row in the table.
    5. Select Columns - Select one or more columns to be included in the region. Select all columns to be displayed.
    6. Click Next.
  10. For Detail Source:
    1. Detail Region Title - Enter a region title for the detail region.
    2. Show Only Related Tables - Specify whether to restrict the list of detail tables to only those tables related to the master table.
    3. Table/View Name - Select the table or view on which the grid is based.
    4. Primary Key Column - Select the name of the column that uniquely identifies a row in the table.
    5. Master Detail Foreign Key - Select the foreign key that relates between the master and detail tables.
    6. Select Columns - Select one or more columns to be included in the region. Select all columns to be displayed.
    7. Click Create.
    The Page Designer appears.
  11. To view the new master detail, click Save and Run Page.
    The rendered page appears.

10.4.4 Creating a Two Page Master Detail Using the Create Page Wizard

Use the Create Page Wizard to create either a two page master detail. A two page master detail features two pages based on two related tables or views. The first page is a non-editable interactive grid. Users click the Edit icon on the first page edit details on the second page.

To create a two page master detail using the Create Page Wizard:

  1. Navigate to the application, or create a new application.
  2. On the Workspace home page, click the App Builder icon.
  3. Select an application.
  4. Click Create Page.
  5. 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 Component and then 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.

  6. On Create Page, select Two Page Master Detail.
  7. On Page Attributes:
    1. Master Page Number - Enter the page number of the master page. The master page will contain a read-only master interactive grid. Enter a new page number or an existing page number.
    2. Master Page Name - Enter the name of the master page.
    3. Detail Page Number - Enter the page number of the detail page. The detail page will contain a form and editable interactive grid..
    4. Detail Page Name - Enter the name of the detail page.
    5. Breadcrumb - Select whether you want to use a breadcrumb navigation control on your page. If you elect to include breadcrumb navigation, additional attributes appear.
    6. Click Next.
  8. 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.
  9. For Master Source:
    1. Table/View Owner - Select the owner of the table on which you are building the interactive grid.
    2. Table/View Name - Select the table or view on which the grid is based.
    3. Primary Key Column - Select the name of the column that uniquely identifies a row in the table.
    4. Form Navigation Order - Select the navigation order column used by the previous and next buttons on the Detail Page which navigates to a different master record.
    5. Select Columns - Select one or more columns to be included in the region. Select all columns to be displayed.
    6. Click Next.
  10. For Detail Source:
    1. Table/View Owner - Select the owner of the table on which you are building the interactive grid.
    2. Table/View Name - Select the table or view on which the grid is based.
    3. Primary Key Column - Select the name of the column that uniquely identifies a row in the table.
    4. Master Detail Foreign Key - Select the foreign key that relates between the master and detail tables.
    5. Select Columns - Select one or more columns to be included in the region. Select all columns to be displayed.
    6. Click Create.
    Page Designer appears.
  11. To view the new master detail, click Save and Run Page.

The rendered pages appear.