Using Subpages

This section provides an overview of subpages and discusses how to:

  • Define subpages.

  • Insert subpages into pages.

  • Specify informational subpage labels.

Subpages are a powerful means of factoring out commonly used page functionality in your application. Rather than duplicating the same set of page fields on two or more pages, you can create a single subpage that contains those page fields and then add it to any page. Subpages provide an easy way to maintain the functionality that the page fields represent.

Subpages are even more effective when used with corresponding subrecords. To support the use of subrecords with subpages, the system uses a record name substitution mechanism for subpage-type page fields. Each subpage has a from record that is determined dynamically by the page definition in PeopleSoft Application Designer and by PeopleSoft Pure Internet Architecture. The from record is a record associated with one of the page fields on the subpage. Which page field depends on the page field ordering, the types of page fields on the subpage, and whether the associated record is a subrecord. The subpage itself must be fully expanded to make this determination. (Keep this fact in mind when working with subpages that contain other subpages.)

You specify the to record in the Subpage Record Name Substitution field in the Insert Subpage dialog box that appears after you insert the subpage into a page. (It also appears on the Subpage tab of the Subpage Properties dialog). At runtime, when a subpage-type page field is expanded, each page field that is associated with the dynamically determined from record is instead associated with the to record that you specify. For example, you can populate a subpage with page fields that are associated with a subrecord so that the subrecord is determined to be the from record; then, when that subpage is used as a subpage-type page field, you can specify the to record as one of the records that contains that subrecord. You are able to associate a single set of page fields (through the subpage) with a variety of different records (each containing the subrecord).

Creating a subpage is like creating a page definition except that you define it as a subpage rather than a standard page in the Page Properties dialog box.

To define a subpage:

  1. Select File > New > Page.

  2. Insert the record fields on the page.

    See Adding Page Controls.

  3. Select File, Definition Properties to access the Page Properties dialog box.

    Use this dialog box to define the type, size, and layout of the page.

  4. Select Subpage in the Page Type drop-down list box.

  5. Select the size of the page.

    See Changing Page Use Information.

  6. Select Adjust Layout for Hidden Fields if necessary.

  7. Select Allow Deferred Processing if appropriate.

    See Understanding Processing Modes.

After you create a subpage definition, insert a subpage control on your primary page and associate it with the subpage definition.

To insert a subpage into a page:

  1. Open the page into which you want to insert the subpage.

  2. Select Insert > Subpage.

    The Insert Subpage dialog box appears.

  3. Select a subpage definition.

    Specify the name of the subpage that you want to insert into the open page definition.

  4. Select a record definition in the Subpage Record Name Substitution field.

    The subpage writes its fields to a generic record. Specify the application-specific record name to which you want the information in the subpage written.

    Note: All of the fields in a subpage must be associated with fields of a subrecord in the specified record definition.

  5. Click the OK button.

    The subpage appears on the page. Its size reflects the size of the page control group, and it is identified by the subpage definition name. During design time, the fields within the subpage are not visible. At runtime, pages containing subpages are dynamically expanded. Be sure to leave a few pixels of space between the left edge of the main page and the subpage page field to ensure sufficient padding at runtime.

When saving a page with multiple subpages, be aware that you may receive a warning message if duplicate fields are present.

Inserting a Subpage Into a Grid

You insert a subpage into a grid as you would any other column.

See Inserting and Manipulating Grid Columns.

Document the purpose of the subpage by changing its informational label. The default subpage label is Subpage. Any label that you attach to a subpage is for information only: it does not appear on the page, but it does appear on the page definition printout and in the control order list. Use labels to differentiate among multiple subpages on a page.

To specify informational subpage labels:

  1. Open the Subpage Properties dialog box.

    Note that the Subpage tab displays the information that you entered on the Insert Subpage dialog box.

  2. On the Label tab, enter your informational text label.

  3. Enter the page field name in the General tab.

  4. (Optional) Select Enable as Page Anchor if you want the subpage to serve as a jump destination on the page.

  5. Click OK.