Field Editing
Summary
How field editing works in the 2Wee client — modes, behavior rules, and visual states.
Purpose
Every editable field in 2Wee has two interaction modes: select mode for navigation and edit mode for text editing. This separation prevents accidental data changes while allowing fast navigation. It is the core Navision interaction pattern.
How it works
Select mode
The default state. The entire field value is highlighted in cyan.
| Behavior | Description |
|---|---|
| Arrow keys | Navigate between fields |
| Typing a character | Clears the field, enters edit mode, inserts the character |
Enter | Move to the next quick_entry field; if none ahead, moves to the next editable field |
F2 | Enter edit mode (cycles: Select All → Cursor End → Cursor Start) |
Esc | Go back (prompts to save if dirty) |
Edit mode
A cursor (█) appears inside the field value. Full text editing is available.
| Behavior | Description |
|---|---|
| Arrow keys | Move cursor inside text |
Enter | Confirm edit, advance to next quick_entry field |
F2 | Cycle: Select All → Cursor End → Cursor Start |
Tab | Confirm edit, move to next field (visits all fields) |
Esc | Revert to original value, return to select mode |
Entering edit mode
F2 enters edit mode with all text selected. The user can:
- Type to replace the entire value
- Press an arrow key to deselect and position the cursor
When entering via typing a printable character, the field is cleared first and the character is inserted.
Enter does not enter edit mode — it navigates to the next quick_entry field. In edit mode, Enter confirms and advances.
Behavior rules
Selection collapse. Plain arrow keys collapse the selection to the near (Left) or far (Right) edge. No character is skipped.
Overwrite-on-type. When a selection is active, typing any printable character deletes the selection first, then inserts.
Backspace/Delete with selection. If a selection exists, both keys delete the selected text. They do not additionally delete a character.
Word delete with selection.
Alt+Backspace/Ctrl+Backspacedelete the selection if one exists. Otherwise they delete backward to the previous word boundary.Revert.
Escin edit mode restores the original value from when editing started.Date fields. On confirm, the input is parsed as Navision shorthand and expanded to full date format. If invalid, the field stays in edit mode with an error.
Time fields. On confirm, the input is parsed as 24-hour time. Separators (
,.) are auto-corrected to:.Validation locks the field. When validation fails (local or server-side), the user cannot leave the field. They must fix the value or press
Escto revert.Input masks. Some fields filter keystrokes: uppercase fields silently convert to uppercase, digits-only fields reject non-numeric input. The server controls this — no configuration needed on the client.
TextArea fields
TextArea fields use the same flat cursor model as regular text fields. The value is a plain string and \n characters are real line breaks within it.
| Key | Behavior |
|---|---|
| Printable char | Enter edit mode, insert at cursor |
Enter | Confirm edit, advance to next quick_entry field |
Ctrl+Enter | Insert a newline at the cursor position |
F2 | Cycle: Cursor End → Cursor Start (Select All is skipped to avoid accidentally clearing multi-line content) |
Ctrl+A | Select all text |
Esc | Revert to original value, return to select mode |
While editing, the bottom bar shows the current line count and a hint: 2/4 Ctrl+Enter New line.
When the cursor is below the visible rows, the field scrolls to follow it. A ↑ indicator appears in the label area when the view is scrolled.
Visual states
| State | Appearance |
|---|---|
| Select mode (focused) | Cyan background, black text |
| Edit mode (no selection) | Dark blue background, white text, █ cursor |
| Edit mode (with selection) | Dark blue background; selected text has lighter blue highlight |
| Drill-down field | Styled (e.g., yellow bold) — signals "you can drill down" |
| Read-only (not drillable) | Gray text |
| Option field | Value with ↓ indicator on the right |
| Dirty field | * prefix on label |