ASNA WingsRPG™ Reference Manual

Changing an Input Selection Field Into a Checkbox

Given a typical green-screen selection list, the user enters a character (in this case a "1") to select the correct Status Code. When the display file is converted to an ASPX page for Wings, this behavior is persisted, as shown in the pictures below:

Figure 1. A traditional green-screen selection list(left) and the Wings default rendering of the same list.

Rather than forcing the user to select a field and press a key, a simple mouse click would probably be easier. When the input field is a DdsCharField swapping out the input field for a checkbox is easy.

To do this, first make sure the application is loaded in Visual Studio and not currently running. Then, give the desired DdsCharField focus and press F4 to display the Properties window (as shown in Figure 2).

Figure 2. A DdsCharField's property list

The DdsCharField's InputStyle property controls its display behavior. If you're viewing the properties in Category order, the InputStyle property is under the "Style" category. The InputStyle property can have one of four values:

  • TextBox - Displays an input field. For standard DDS input fields, this is the default.
  • MultiLine - Displays the input area as a multiline text area. You might use this setting for note- or memo-type fields.
  • Password - Displays placeholder characters rather than the characters typed.
  • CheckBox - Displays a checkbox. This settings tranforms an input field into a toggleable value.

When the InputStyle is CheckBox, then CheckedValue and UncheckedValue properties come into play. These properties define the values returned to the program depending upon the checked state of the field. The value assigned to the CheckedValue property is assigned is the value returned from the display file when the checkbox is selected.

Figure 3. A Monarch/Wings DdsCharField displayed as a checkbox.

Given the property setting in Figure 2 (where CheckedValue is "1") the screen fragment shown returns a "1" in the input field in the subfile row selected.

The UncheckedValue is returned when the checkbox is not selected. In the case where the RPG program doesn't need a value when an item isn't selected, you can leave the UncheckedValue property empty. There may be times when you need to specify values for both checked and unchecked states. For instance, "Y" could mean "YES" and "N" could mean "NO" to the RPG program. In this case, you'd set the CheckedValue and UncheckedValue properties as shown in Figure 4.

Figure 4. CheckedValue and UncheckedValue will return "Y" or "N" respectively.

Although the CheckedValue and UncheckedValue properties are typically one character long, they don't have to be. Strings of any length will work. For example, you may be returning an inventory code for the item selected or want to return a default item if the checkbox isn't selected.