Skip to content

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.

BehaviorDescription
Arrow keysNavigate between fields
Typing a characterClears the field, enters edit mode, inserts the character
EnterMove to the next quick_entry field; if none ahead, moves to the next editable field
F2Enter edit mode (cycles: Select All → Cursor End → Cursor Start)
EscGo back (prompts to save if dirty)

Edit mode

A cursor () appears inside the field value. Full text editing is available.

BehaviorDescription
Arrow keysMove cursor inside text
EnterConfirm edit, advance to next quick_entry field
F2Cycle: Select All → Cursor End → Cursor Start
TabConfirm edit, move to next field (visits all fields)
EscRevert 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

  1. Selection collapse. Plain arrow keys collapse the selection to the near (Left) or far (Right) edge. No character is skipped.

  2. Overwrite-on-type. When a selection is active, typing any printable character deletes the selection first, then inserts.

  3. Backspace/Delete with selection. If a selection exists, both keys delete the selected text. They do not additionally delete a character.

  4. Word delete with selection. Alt+Backspace / Ctrl+Backspace delete the selection if one exists. Otherwise they delete backward to the previous word boundary.

  5. Revert. Esc in edit mode restores the original value from when editing started.

  6. 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.

  7. Time fields. On confirm, the input is parsed as 24-hour time. Separators (, .) are auto-corrected to :.

  8. Validation locks the field. When validation fails (local or server-side), the user cannot leave the field. They must fix the value or press Esc to revert.

  9. 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.

KeyBehavior
Printable charEnter edit mode, insert at cursor
EnterConfirm edit, advance to next quick_entry field
Ctrl+EnterInsert a newline at the cursor position
F2Cycle: Cursor End → Cursor Start (Select All is skipped to avoid accidentally clearing multi-line content)
Ctrl+ASelect all text
EscRevert 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

StateAppearance
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 fieldStyled (e.g., yellow bold) — signals "you can drill down"
Read-only (not drillable)Gray text
Option fieldValue with indicator on the right
Dirty field* prefix on label