Choice cards display some text followed by a list of items from which the user can choose a single item, called a choice entry. To define a choice card, you use a <CHOICE> statement. The statement must include one or more <CE> statements defining the items on the list.
<CHOICE
| |
A name for the card. Other cards can specify this name as a destination. | |
Flag specifying whether the card can be marked. To allow the card to be marked, specify
Always set
If you set the | |
The default bookmark name that appears when the user marks the card. | |
The URL the phone adds to the bookmark list if the user marks the card. If you do not specify the | |
The name of the variable that gets the value (if any) of the chosen item. | |
The name of a variable containing an index number specifying the default item. The number
For example, if
If you don't specify the
When the user chooses an item, the phone sets the variable specified by | |
The choice method. To make the list numbered, specify
To make the list unnumbered, specify
If you do not specify the | |
The default value of the variable specified by the | |
The index of the default entry, if the | |
>
| |
The actions to execute when the user presses a function key. If the choice item the user chooses specifies a task, it takes precedence over these actions. For more information on specifying actions, see <ACTION>. | |
A formatted text title to display above the list of items. It should be as brief as possible.
Avoid using the Avoid using more than 24 characters of text. If you use more, it will scroll off the top of the screen on many devices and the user will have to scroll back to read the entire title. For more information on specifying formatted text, see Formatted text. | |
An item (choice entry) the user can choose. For a description of the
| |
</CHOICE>
|
The following HDML deck generates the display shown in Figure 2-6:
If the user presses 3 (or scrolls to the third item and presses ACCEPT), the current URL is called with the following arguments:
The phone sets the variables specified by the IKEY and IDEFAULT options according to which choice item is selected when the user leaves the card. The phone always sets these variables, regardless of the softkey the user presses to leave the card.
IKEY and IDEFAULT options even if the user presses a key other than ACCEPT to leave a choice card. For example, the phone sets the variables even if the user presses PREV.
Suppose we modify the previous example deck so that the first card displays the variables specified by IKEY and IDEFAULT.
If the user goes to the choice card and then immediately presses PREV to return to the first card, the first card displays the variable values as shown in Figure 2-7.
FIGURE 2-7. Pressing keys other than ACCEPT in a choice card