Many applications require a "form" style of entry, in which the user enters data in a form containing associated data fields. For example, an address book application might allow the user to enter addresses in forms containing name and address fields. Some applications may allow the user to use forms that set related preferences.
Unwired Planet recommends that you implement an interface for these applications in the following manner:
GOSUB task (activity) that allows the user to edit the field value displayed by the choice entry. Providing a separate activity to edit each choice entry allows the user to easily cancel editing.
GOSUB task that allows the user to edit a choice entry should automatically advance the user to the next choice entry. It can do this by returning a variable that sets the IKEY option of the choice card. This is illustrated in the sample code below.
The following code provides a very simple implementation of this type of interface. Figure 8-9 depicts the interface.
FIGURE 8-9. Entry form implementation
Note that the activity that allows the user to edit the first choice entry sets the curItem variable (the variable used to set the default choice item) to 2. Thus, after the user finishes editing the first choice item, the second item will be the default. This saves users the trouble of scrolling to the second item after they have finished editing the first item.
To implement a "lookup" or search form, you use an interface similar to that described in the previous section. However, instead of changing the SOFT1 key label to Save, change it to Find.