<ACTION LABEL=keylabel
    TYPE=key
    TASK=tasktype
    DEST=destURL
    VARS=varpairs
    RECEIVE=varlist
    RETVALS=vallist
    NEXT=nextdest
    CANCEL=canceldest
    FRIEND=boolean
    SENDREFERRER=boolean
    CLEAR=boolean
    NUMBER=number
    IMAGE=URL>

An action associates a task with an UP.Phone function key (ACCEPT, PREV, or HELP, SOFT1-SOFT2). When the user presses the function key, the UP.Phone executes the task.

The following tasks are currently supported:

Action precedence for function keys

You can specify actions and tasks at several levels in HDML. For example, both a card and the deck that contains it can include actions that specify tasks for ACCEPT. The UP.Phone uses the rules of precedence described in the sections below to determine which task to execute.

ACCEPT

When the user presses ACCEPT, the UP.Phone uses the following rules to determine what action to take:

  1. If the current card is a choice card and the choice entry the user selected specifies a task, it executes the task and skips the following rules.
  2. If the current card defines an action for ACCEPT, it executes the task specified by the action and skips the following rules.
  3. If the current deck defines an action for ACCEPT, it executes the task specified by the action and skips the following rule.
  4. Displays the previous card.

PREV

When the user presses PREV, the UP.Phone uses the following rules to determine what action to take:

  1. If the current card defines an action for PREV, it executes the task specified by the action and skips the following rules.
  2. If the current deck defines an action for PREV, it executes the task specified by the action and skips the following rule.
  3. Displays the previous card. If the current card is the first card in the current activity, the UP.Phone cancels the current activity and returns to the card that originally invoked it.

SOFT1-SOFT2

The UP.Phone handles the softkeys, SOFT1-SOFT2, in a similar fashion. The rest of this manual uses the term SOFTx to describe behavior that applies to SOFT1-SOFT2.

When the user presses SOFTx, the UP.Phone uses the following rules to determine what action to take:

  1. If the current card defines an action for SOFTx, it executes the task specified by the action and skips the following rules.
  2. If the current deck defines an action for SOFTx, it executes the task specified by the action and skips the following rules.
  3. Nothing.

If you have specified an action for a key at the deck level but you want the key to be inactive in an individual card, specify an action with no task for the card.

HELP

When the user presses HELP, the UP.Phone uses the following rules to determine what action to take:

  1. If the current card defines an action for HELP, it executes the task specified by the action and skips the following steps.
  2. If the current deck defines an action for HELP, it executes the task specified by the action.
  3. Displays a built-in card containing a message that no help is available for the current location.

Syntax

LABEL=keylabel   The label for the key. keylabel should be five characters or shorter. If you are associating a task with the ACCEPT key, the label is optional. If you are associating a task with the PREV key, any label you specify is ignored. Otherwise, the label is required. The default label for the ACCEPT key is OK.  
TYPE=key   The key with which to associate a task. Possible values are: ACCEPT HELP PREV SOFT1 SOFT2 For a description of the default actions and action precedence for each of these keys, see Action precedence for function keys.  
TASK=tasktype   The task to execute. Possible values are: GO: requests the URL specified by the DEST option. GOSUB: requests the URL specified by the DEST option, spawning a nested activity. RETURN: returns from a nested activity to the previous activity. CANCEL: cancels the current nested activity, returning to the previous activity. PREV: displays the previous card in the activity history. If the current card is the first card, PREV has the same effect as CANCEL. CALL: places a phone call to the number specified by the number option. NOOP: does nothing. See the table below for more detailed descriptions of these tasks and the options you can use with them.  
DEST=desturl   The URL to request in GO and GOSUB tasks. If the current activity is nested and the task is a RETURN or CANCEL task, DEST specifies a URL to request upon returning to the calling activity. However, if the calling activity does not designate the current activity as "friendly," the UP.Phone ignores the DEST option. The DEST option overrides the NEXT or CANCEL options of the calling activity.  
VARS=varpairs   A list of variables to set for the current activity (if the task is GO) or nested activity (if the task is GOSUB). The variable list must be in query-string format, for example: var1=value1&var2=value2 Variable values must be escaped according to URL escaping conventions. The phone unescapes the VARS option before setting the value of the variables.  
RECEIVE=varlist   A semicolon-delimited list of variables to which the phone stores the return values from a GOSUB task. The phone stores return values according to ordinal position. For example, if you specify the following option:
receive=var1;var2 the phone stores the first return value to var1 and the second return values to var2. If you want to skip a return value, you must include a semicolon as a placeholder. For example, to ignore the first return value and store the second return value to var2, you specify the following option:
receive=;var2
 
RETVALS=vallist   A semicolon-delimited list of values that an activity invoked with GOSUB returns to the invoking activity. The RETVALS option is allowed only with the RETURN task. The values must be escaped according to URL escaping conventions.  
NEXT=nextdest   The URL to request after a nested activity returns. If the FRIEND option in the GOSUB task is set to TRUE, the NEXT option can be overridden by the DEST option in the nested activity's RETURN task.  
CANCEL=canceldest   The URL to request after a nested activity invoked by a GOSUB task cancels. If the FRIEND option in the GOSUB task is set to TRUE, the CANCEL option can be overridden by the DEST option in the nested activity's CANCEL task.  
FRIEND=boolean   A boolean value specifying whether the nested activity specified in a GOSUB task is "friendly." A friendly nested activity can use the DEST and CLEAR options in RETURN and CANCEL tasks and override the NEXT and CANCEL options of the calling task. To indicate the nested activity is friendly, specify TRUE. The default is FALSE.  
SENDREFERER=boolean   A boolean value specifying whether the UP.Browser should provide the URL of the current deck when requesting the URL specified by the DEST or NEXT options. If you set it to TRUE, the UP.Browser specifies the deck's URL in the "Referer" header of the request. The UP.Browser attempts to use the shortest possible relative URL in the "Referer" header if possible. The default value is FALSE.  
CLEAR=boolean   A boolean value specifying whether a RETURN or CANCEL task from a nested activity unsets all the calling activity's variables. To unset the calling activity's variables, specify TRUE. The default is FALSE. The phone ignores the CLEAR option unless the calling activity specifies that the current activity is "friendly."  
NUMBER=number   For a CALL task, the phone number to call.  
IMAGE=url   The URL of an image to display above the softkey.  

Task types

The following table lists the task types you can specify for the TASK option. It also lists the other options you can use with each task type. Required options appear in bold.

Task   Description   Options  
GO   Requests the URL specified by the DEST option. If you use the GO task, you can only specify a relative URL for the DEST option.   DEST, VARS, SENDREFERER  
GOSUB   Pushes a new activity onto the activity stack and requests the URL specified by the DEST option. When the nested activity returns, the phone puts the nested activity's return values into the variables specified by the RECEIVE option. If the nested activity cancels, the phone requests the URL specified by the CANCEL option.   DEST, VARS, SENDREFERER,FRIEND, RECEIVE, NEXT, CANCEL  
PREV   Displays the previous card in the activity history. If the current card is the first card in the current activity, PREV has the same effect as CANCEL.    
RETURN   Returns from a nested activity to the previous activity with the return values specified by the RETVALS option.   RETVALS, DEST, CLEAR  
CANCEL   Cancels the current activity, requesting the URL specified by the previous activity's CANCEL option. If no CANCEL option is specified, the phone requests the current card in the previous activity.   DEST, CLEAR  
CALL   Switches the phone to voice mode and dials the number specified by the NUMBER option.   NUMBER  
NOOP   Do nothing. This is useful for disabling the default behavior of the specified action.