Form items

Empty items (that is, containing no data) can be hidden in a form’s View state. However, this is not a requirement; forms can be designed either way, depending on which is better for the given application.

Unlike ordinary list items, the form items may have different sizes in the layout, but only in the Edit state. A long data field may occupy more than one line in the Edit state, but in the View state it is truncated to the first line.

The user may be able to add and remove form items. This is done with commands in the Options menu.

Form items always have a label. The label has a text part, or a text and a graphical part. However, all items in one form must have the same column layout (see List layouts for detailed information about layouts).

The following item types can be used in a form:

  • Text field (alphanumeric or numeric content)

  • Pop-up field

  • Slider

Any combination of these types is possible within one form.

When a form is in the Edit state, the user can move the focus up and down, as in a list. The highlight in the Edit state is different from the highlight in the View state, acting as a visual cue. The cursor blinks in the text field that is in focus. The cursor blinks in the text field that is in focus. There is no need to save each field separately; the user can browse and modify the fields in any order and then accept all modifications. During the browsing of a form in the Edit state, the keypad functions are as follows:

Table: Default key events in editing state of a form
Key Action

Arrow up / Arrow down

Move the focus between form items (when in a text field, move the cursor within an item line by line).

Arrow left / Arrow right

  • Pop-up: changes the value without opening the list.

  • Text: moves the cursor character by character.

  • Slider: adjusts the slider value.

Selection

  • Pop-up field: opens the list.

  • Text field: opens the context sensitive Options menu or no action.

Clear

  • Pop-up: ignored.

  • Text: deletes characters.

  • Slider: ignored.

Numeric keypad

  • Pop-up: ignored.

  • Text: input.

  • Slider: ignored.

Other keys

The default action of the key.

Table: Form field types
Field Description
Text

Contains numeric or alphanumeric data. It can be edited directly using the usual editing functions when the form is in the Edit state. The text field can expand to more than one line if necessary.

In the View state, a text field looks identical to a corresponding list item.

Pop-up

Offers the possibility of choosing one value from a predefined list. In the View state, a pop-up field looks identical to a list item; the text is the current value of the field. In the Edit state, it has a distinct look that identifies the field as a pop-up list.

To edit an item in the Edit state, the user can press the Selection key, which opens a menu list that contains the available values. The highlight is on the current value. When the list is open, the softkeys are OK and Cancel, as is usually the case with a menu list. Both the softkeys return to the Edit state in the form.

A pop-up field may also allow the user to enter a textual value in addition to the predefined values. In this case, the last option is named, for example, Other, and selecting it opens a Data query.

Using forms in applications

The API to use for creating forms is the Form API. For more information, see Symbian C++ API specifications.