Record Selection Wizard


Overview


This wizard creates a pop-up subfile that allows the user to choose from a list of values. The selected value is generally placed into a textbox on a different page. Here is an example:

The pop-up subfile on the right will place a value into the Process Type Document field of the form on the left. This is similar to field prompting in green-screen applications.

The record selection subfile works in conjunction with a special type of input field called a "Textbox w/ selection". You can create this field using either the Database Repository field properties or the Insert RPG Field Wizard. You will, of course, need to place the field on a different form than the record selection subfile itself.


The Database Repository and/or Insert RPG Field Wizard will ask you for selection subfile's program name:

You must specify the same name as the document name provided in this wizard.

Since the textbox w/ selection uses JavaScript for the pop-up functionality, you may also be instructed to place a line of code to import the needed JavaScript logic.

You should paste this line of code in between the <HEAD> and </HEAD> tags of your document.

The Record Selection Subfile Wizard can be started from the Wizards Menu. The first wizard page prompts you for miscellaneous document attributes.

 

Document Attributes

 

Create New Document (Yes/No)

By default, the wizard creates a new subfile page and places the generated code into it.

If you would like to integrate the generated subfile into an existing page, click on the No radio button. This option will insert the new content into the active document. The content will be placed at the current insertion point of the active document.

Document Name

Indicates the name of the new record selection subfile page to create. This name will be used when you save the generated source file. It will also be used to name the created program object during compilation. The name is limited to 10 characters or less because iSeries object names must not exceed 10 characters.

Free-Format RPG

When this box is checked, all RPG code generated by the wizard will use free-format RPG. If you would like the wizard to generate fixed-format Calculation Specifications, leave this box unchecked.

Title

Indicates the document title and the document heading to generate. Theme templates control where and how the title field is used by utilizing the !title! placeholder.

Theme Selection and Preview

A Theme is a set of template files that describe the look of a generated application. Template files use standard html in combination with special placeholders. In the subfile wizard, you can preview and select a theme by clicking on the button labeled with three dots next to the theme text field. When the theme selection window pops up, select the appropriate theme, and click Ok. A preview of the theme will be shown in the preview window. You can zoom in and out using the + and - buttons.

You can change existing themes or create your own by selecting the Wizards -> Themes pull-down menu option.

 

Subfile Field Selection

File Name

Type in or select the name of a physical or a logical file. This file will be used to retrieve the data records from. If you plan to use multiple files, select the primary file first. If you have retrieved the field definitions for this particular file before, the record format name and available fields will automatically be populated from the local database repository; otherwise, you must click the blue button to get the field list from the iSeries.

Library Name

The Library Name field is used for locating the specified file when the "Get Field List from iSeries" button is used. It is recommended that you leave this field blank, in which case the compile-time library list defined under Tools -> Options is used. To change the library list on the fly, click on *LIBL.

Field to return the record selection value

Select the field whose value will be placed back into the textbox once the user selects the record. Most of the time, this is the file's key field.

Related Files

Pressing this button will open the Add Related Files dialog, where you can specify one or more related database files to be used by your subfile application. If you have already added related files, the Related Files dialog will open, where you can change or remove files you have already added, or add more related files. After you have defined one or more related files, their fields will appear for selection in the Available Fields box.

Available Fields / Selected Fields

The Available Fields box shows you the file fields you can select for your record selection subfile. If no fields appear, click the blue button to get the field list from the iSeries. The box shows you the field name, the field description, the field length and type, and the key sequence for keyed fields.

The Selected Fields box shows the fields you have selected to display in your record selection subfile. Generally, you should select only the most important fields for the subfile page.

Moves a field or fields from the Available to the Selected Fields box. Prior to clicking on this button, you should select one or more fields in the Available Fields box.

Moves all Available Fields to the Selected Fields box.

Removes a field from the Selected Fields box.

Removes all fields from the Selected Fields box.

 Changes the order of the selected fields by moving the chosen field up one position.

 Changes the order of the selected fields by moving the chosen field down one position.


How the selected fields appear in the generated subfile is defined in the database repository's Output HTML field property. A snippet of HTML code is assigned to each field to determine how the field will appear (standard, dynamic image, trimmed spaces, URL, multi-line text, etc.)
Right-clicking on a field name will open the Field Properties dialog, where you can specify these properties.

 

Subfile Details

Alternate Row Color

Select this option if you want RPGsp to generate code that will alternate the background of each subfile row as the subfile is being loaded. The subfile theme template must support this feature by using the !rowcolor! placeholder.

Row Color 1

Specifies the color for the odd-numbered rows.

Row Color 1

Specifies the color for the even-numbered rows.

Row Color

When the Alternate Row Color checkbox is not selected, this field specifies the background color of all subfile rows. The subfile theme template must support this feature by using the !rowcolor! placeholder.

Add Search/Lookup Capability

This option, if selected, will automatically add a lookup box to your record selection subfile based on the key of the file. For example, if your file is keyed by the Customer Number field, the generated application will allow users to position to any record in the record selection subfile by typing in a Customer Number.

Load Page at a Time

This option determines if the application should load all of the file records onto the page at once or load only a certain number of records at a time. For the latter, the wizard generates first page, previous page, next page, and last page links, along with the RPG logic to keep track of the subfile's position.

Number of Records per Page

Determines the number of records to load into the subfile at once when Page at a Time is used.

Subfile Actions

The record selection wizard automatically pre-fills an action for selecting a record.

You can attach other actions to each record being loaded into the subfile. The following action types are available:

Actions Labels

The action label is the text or link name that will appear on each record to represent the action.

Action Smart Page Names

This is the name of the RPG Smart Page that will process the action. This does not apply to the Select action.

Action URL's

The URL or JavaScript command of each action is automatically built for you. You can make modifications to the automatically built URL if needed.

Create Page Now

If you have selected view, change, delete, or add actions, the wizard can generate the appropriate action pages for you. Select one or more Create Page Now checkboxes to generate these pages. When you click Next, the wizard will ask you questions relevant to building these extra pages.


Finishing the Wizard

Click Finish to start generating the selected page or pages. After the generation process is complete, you must compile each page before you can launch and test the application.

 


Profound Logic Software, Inc.
www.ProfoundLogic.com
(937) 439-7925