Create Dropdowns in m-Painter

 

Jump to:
Creating Drop-Down Lists from the Current Application
Creating Drop-Down Lists from an External Table
Creating Drop-Down Lists in the Interactive Report Template
Release Notes

This document explains the two ways to implement drop-down lists: From the current application (applies to Retrievals & Reports templates) and from an external table (applies to Retrievals, Reports, and Maintenance templates).

Build your application as you normally would. Next, open m-Painter. Find the input box that you would like to convert into a drop-down box. From the image below, you can see I am working with a Multiple Record Retrieval.

Right-click on the input box you want to convert, and select "Insert/Edit Option List" (Or you can left click on the input, and select the "Insert Option List" button from the m-Painter toolbar). A dialog will appear. Below, each option is explained:

Type — This list contains the different inputs you can choose:

  • Drop-Down list — This option will change your input into a drop-down list.
  • Radio Buttons — While not as popular as the drop-down list, radio buttons are usually used when the number of options is less than 10.
  • Text Input — Choosing this option will revert your input back to the standard text input. This option is the only one that allows your end-user to free type.

Blank Option Text — If there is a value in this input, it will be used as the default value for the drop-down list. A very common value for this option is "Select a …" (Replacing … with the appropriate subject matter). If you do not specify default text, the end user is forced to select a value from their drop-down list.

Option Data Source — You have two valid options:

  • Current App — Your drop-down list is populated by analyzing the current table, and using values found in the table for the particular field.
  • Option Sort Order (Current App only) — This option allows you to control whether your list will populate in Ascending or Descending order.
  • External Retrieval — In this instance, your drop-down list is populated by querying the retrieval you select and returning all values.
  • Select External Retrieval (External Retrieval only) — This list will show all applications compiled with the Option List template.
  • Cascading? (Report only, Current App only) — This option allows the prompt page of your report to filter drop-down lists based on the selections made within other drop-down lists.

Apply to Field — This option tells m-Painter where to build your drop-down list. The value in this input box is decided by which input you clicked on when you created the drop-down list and does not need to be modified.

The below screenshot is the result set from our Current App drop-down list. Notice how in my small dataset, only the states listed in the table are available to select.

Creating Drop-Down Lists from the Current Application

In this section we will cover how to create a drop-down from the current application.

  1. Right click on the input box you want to convert, and select "Insert/Edit Option List" (Or you can left click on the input, and select the "Insert Option List" button from the m-Painter toolbar).
  2. In the Type Drop-Down List, select "Drop-Down List" or "Radio Buttons".
  3. Enter a "Blank Option Text" (Optional).
  4. In the Option Data Source, select "Current App"
  5. In the Option Sort Order, select "Ascending" or "Descending".
  6. If working in a Report, you have the option of select the "Cascading" option. To implement "Cascading" you will need to select this option on more than one drop-down.
  7. Unless you have clicked on the wrong input box, you will not need to change the "Apply to Field" text area.

Click "OK". Save and run your application.

Creating Drop-Down Lists from an External Table

In this section we will cover how to create a drop-down from an external table.

  1. The first thing we need to do is build our Inquiry/Retrieval that will serve as the data source for our external list. Build a retrieval that consists of either one or two fields. In the case of a retrieval with one field, it is assumed by m-Power that your drop-down value and description will be the same. With two fields, you have the option of choosing which field is the value field and which is the description field.
  2. Be sure to compile your application using the Option List template. Compile your application and open Application Properties.
  3. The option list_value allows you to specify the value field. This field will be the field that is sent to the database. Whereas the list_description option allows you to control what field the end user will see in the database. For example, in an example where U.S. States are used in a dropdown box, "CA" may be the list_value and "California" would be the list_description. Specify the necessary fields and press "OK".
  4. Next, open the application that will use this external table and right-click on the input box you want to convert, and select "Insert/Edit Option List" (Or you can left click on the input, and select the "Insert Option List" button from the m-Painter toolbar).
  5. In the Type Drop-Down List, select "Drop-Down List" or "Radio Buttons".
  6. Enter a "Blank Option Text" (Optional).
  7. In the Option Data Source, select "External Retrieval".
  8. Select your retrieval from the "Select External Retrieval" drop-down list. If you are using an existing retrieval that is not a Option List template, you can free type the application address (DataDictionary.Application Number) in the provided text area.
  9. Unless you have clicked on the wrong input box, you will not need to change the "Apply to Field" text area.
  10. Click "OK". Save and run your application.

The below screenshot is the result set from our External table drop-down list. Notice how even though my dataset is still small, all 50 states are available. This is because the current table is not queried, but instead my external table (which contains all 50 states) is being used.

Creating Drop-Down Lists in the Interactive Report Template

The Interactive Report Template allows for two "bonus" drop-down list options:

  • Button Lists
  • Check Box Lists

Both the Button List and the Check Box List allow you to create a list from the Current Application or from an External Table.

When creating either of these lists you will have the option of specifying how wide each item is and also how many items you wish to appear on each row.

After clicking "Accept", please note that your Button/Check Box List will still render as drop-downs in m-Painter. Rest assured that at run-time they will appear correctly.

An Example of
the Button List
Functionality
An Example of
the Check Box List
Functionality

Release Notes

  • The method of applying Current Application drop-down lists with User Defined Field Codes of "A", "B", and "D" will continue to work for current applications but have been deprecated for future use.
  • The method of applying External drop-down lists with External Objects will continue to work for current applications but have been deprecated for future use.
  • The Option List template is not designed or intended to be run as a stand-alone application.
  • If you select "Radio Buttons" and a "Blank Option Text", the text will receive its own radio button.
  • If you select a "Drop-down List" and do not enter a "Blank Option Text", the user will be forced to select a drop-down value. Furthermore, in cases of Multiple Record Retrievals and Work-with Maintenance, the user will be forced to select a value when paginating, searching, or sorting records.
  • When using the "Is In the List" relationship with an External table drop-down list, there is a known issue with values containing spaces.