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


Multiple-choice fields

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

Use a multiple-choice selection field when you have several choices for the user, but they are not mutually exclusive. Each choice acts independently as a toggle, and selecting one of the choices does not affect any of the other choices in the selection field.

To preselect choices in a multiple-choice selection field, and to find out which choices were selected by the user, specify the CHECKVAR, MATCH, and NOMATCH attributes for each CHOICE tag.

On a multiple-choice selection field, define a unique check variable for each enclosed CHOICE. You can let the MATCH value default to 1, or specify the MATCH attribute with a value of your choice. Also, you can let the NOMATCH value default to 0, or specify the NOMATCH attribute with a value of your choice. Here is how a multiple-choice selection field is coded:
<!doctype dm system>

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

<varlist>
  <vardcl name=dry varclass=sampcls>
  <vardcl name=cut varclass=sampcls>
  <vardcl name=per varclass=sampcls>
  <vardcl name=fac varclass=sampcls>
  <vardcl name=man varclass=sampcls>
  <vardcl name=ped varclass=sampcls>
  <vardcl name=ch1 varclass=sampcls>
  <vardcl name=ch2 varclass=sampcls>
  <vardcl name=ch3 varclass=sampcls>
  <vardcl name=ch4 varclass=sampcls>
  <vardcl name=ch5 varclass=sampcls>
  <vardcl name=ch6 varclass=sampcls>
</varlist>

<panel name=multsel>Schedule Appointments
  <area>
    <dtacol pmtwidth=45 selwidth=76>
    <selfld type=multi>Choose the services needed, then press Enter.
      <choice name=ch1 checkvar=dry>Dry haircut
      <choice name=ch2 checkvar=cut>Shampoo, haircut, and style
      <choice name=ch3 checkvar=per>Permanent or body wave
      <choice name=ch4 checkvar=fac>Facial
      <choice name=ch5 checkvar=man>Manicure
      <choice name=ch6 checkvar=ped>Pedicure
    </selfld>
    </dtacol>
  </area>
</panel>

You specify preselected choices for a multiple-choice selection field just as you would for a single-choice selection field. Set the check variable for the preselected choices to the match values (or the default value of 1) for those choices. When a choice is preselected, a slash (/) is displayed in the entry field preceding the choice.

When the user types a value in an entry field in a multiple-choice selection field, ISPF toggles the choice in this way:
  • If the choice is already selected and the user enters a blank in the entry field, ISPF deselects the choice and sets the check variable to the NOMATCH value for the choice, or to 0 if the NOMATCH attribute is not specified.
  • If the choice is not selected and the user types a nonblank character in the entry field, ISPF selects the choice and sets the check variable to the MATCH value for the choice, or to 1 if the MATCH attribute is not specified. If the choice is not selected, ISPF sets the check variable to the NOMATCH value for the choice, or to 0 if the NOMATCH attribute is not specified.

In the preceding markup, the MATCH attribute was not specified, so the check variables toggle between 0 and 1 (the default MATCH and NOMATCH values) as the user selects and deselects items.

Because ISPF is setting the check variable, you should not use the SETVAR or the TOGVAR attributes of the ACTION tag to refer to the check variable.

Figure 1 shows how the multiple-choice selection field in the preceding markup appears with the choices Facial and Pedicure preselected.

Figure 1. Multiple-choice selection field
                           Schedule Appointments

 Choose the services needed, then press Enter.
 _  Dry haircut
 _  Shampoo, haircut, and style
 _  Permanent or body wave
 /  Facial
 _  Manicure
 /  Pedicure












 

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014