z/OS ISPF Dialog Tag Language Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Single-choice fields

z/OS ISPF Dialog Tag Language Guide and Reference
SC19-3620-00

Use a single-choice selection field when you have a fixed set of choices that are mutually exclusive. That is, the user can select only one of the choices by typing the choice number in the entry field. You can specify the preselected choice in a single-choice selection field so that one item is already selected when the panel is displayed. The user can either leave the preselected choice or enter a different choice number.

To preselect choices in a single-choice selection field, and to find out which choice was selected by the user, you should specify the CHECKVAR and MATCH attributes for each CHOICE tag. For a single-choice field, all of the enclosed choices should refer to the same check variable, but they should have unique MATCH values. The example markup shows how this is coded:
<!doctype dm system>

<varclass name=daycls type ='char 1'>

<varlist>
  <vardcl name=day varclass=daycls>
  <vardcl name=choice varclass=daycls>
</varlist>

<panel name=singsel>Schedule Appointments
  <topinst>Choose the most convenient day for your appointment,
           then press Enter.
  <area>
    <selfld name=choice selwidth=30 pmtwidth=9>Weekdays:
      <choice checkvar=day  match=M>Monday
      <choice checkvar=day  match=T>Tuesday
      <choice checkvar=day  match=W>Wednesday
      <choice checkvar=day  match=H>Thursday
      <choice checkvar=day  match=F>Friday
    </selfld>
  </area>
</panel>

To preselect a certain choice, set the check variable, day, to the match value for that choice. Assume that the check variable, day, is set to M before the panel is displayed. When the panel is displayed, the choice, Monday, is selected as shown in Figure 1.

Figure 1. Single-choice selection field
                           Schedule Appointments

 Choose the most convenient day for your appointment, then press Enter.

 Weekdays:
 1   1.  Monday
     2.  Tuesday
     3.  Wednesday
     4.  Thursday
     5.  Friday











 
If the user decides that another day is more convenient, another choice might be selected. This causes the check variable to be updated with the match value of the newly selected choice. For example, if the user selects Friday (by typing "5" in the entry field), the check variable, day, contains "F" when control is returned to the application.
Note: The TYPE attribute does not have to be specified on a single-choice selection field because TYPE=SINGLE is the default. However, you must specify the NAME attribute for single-choice selection fields.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014