A form is a specific kind of selection list, where all items (fields) have some editable content.
A form can be in the View state or in the Edit state. The item layouts and functionality are different in these states:
In the View state, the items are not editable. The form functions and looks exactly like a similar selection list. Items can be selected to perform an application-specific function.
In the Edit state, the user can edit all the fields. Forms can contain text fields (alphanumeric or numeric content), pop-up fields and sliders.
The user can switch from the View state to the Edit state using the Edit command in the Options menu.In the Edit state, the contents of the form can be accepted using the right softkey labeled as Done. The form then returns to the View state.
The API to use for creating forms is the Form API. For implementation information, see Using the Form API.
Typically, a form will be derived from the class CAknForm
and
the methods SaveFormDataL()
and DoNotSaveFormData()
will be implemented by the developer. These are called when users
switch from edit mode to view mode and are prompted by the form as to whether
they wish to save their modifications.
For customization, the class CAknForm
provides
a single-line or double-line layout and it is possible to use icons on forms.
In
the following example, the form is pushed on the cleanup stack before ConstructL()
(a
potentially leaving method) is called, and popped off before ExecuteLD()
.
CAknExFormAdd* form = new(ELeave) CAknExFormAdd; CleanupStack::PushL(form); form->ConstructL(); CleanupStack::Pop(); form->ExecuteLD(R_AKNEXFORM_TEXT_FIELD_DIALOG);