Navigation and queries
Record movement, the navigation bar, shortcut keys and query by example.
In this documentation
- Beep.Forms
- Architecture
- Authoring in the Object Navigator
- WinForms runtime
- WPF runtime
- End-to-end example
- Remote UI limitations
- Overview
- Context menus
- Blocks and items
- Triggers
- Lists of values
- Validation
- Master detail
- Navigation and queries
- Alerts, editors and timers
- Calling other forms
- Form menus
- Hosting in WinForms step by step
- Hosting in WPF step by step
- Saving and loading forms
- The IDE toolbar and dialogs
- Troubleshooting
Moving
The host offers MoveFirstAsync, MovePreviousAsync, MoveNextAsync, MoveLastAsync, MoveToRecordAsync(block, index), GoToItemAsync, SwitchToBlockAsync and TrySetActiveBlock. History: NavigateBackAsync, NavigateForwardAsync, CanNavigateBack, CanNavigateForward, GetNavigationHistory, ClearNavigationHistory. Bookmarks: SetBookmark, GoToBookmark, RemoveBookmark, ClearBookmarks. Tab order: GetNextItem, GetPreviousItem, SetTabOrder, GetTabOrder.
Item sequence on Tab or Enter
- The presenter validates the value.
- The item is validated with OnBlur timing.
WhenValidateItemfires.PostTextItemfires.- The
KeyNextItemorKeyPreviousItemkey trigger fires. PreTextItemfires on the target item.WhenNewItemInstancefires on the target item.- Focus moves.
Shortcut keys
Both hosts bind these keys.
| Key | Command |
|---|---|
| F4 | DuplicateRecord |
| F6 | CreateRecord |
| Shift+F6 | DeleteRecord |
| F7 | Key trigger F7, which enters query mode |
| F8 | ExecuteQuery |
| F9 | ListValues (shows the list of values) |
| F10 | Commit |
| Ctrl+R | Rollback |
| Ctrl+Delete | ClearRecord |
| Ctrl+Down | NextRecord |
| Ctrl+Up | PreviousRecord |
The navigation bar
WinFormBlockNavigationBar and BeepWpfBlockNavigationBar implement IBlockNavigationBar. Properties: BlockName, CurrentRecordIndex, RecordCount, IsQueryMode. Events: FirstClicked, PreviousClicked, NextClicked, LastClicked, RecordIndexChanged, NewRecordClicked, DeleteClicked, QueryClicked, ExecuteClicked, SaveClicked, RollbackClicked.
Assign the bar to the block's NavigationBar property before the block is bound. The WinForms host finds bars on its own and matches them to blocks by BlockName. The WPF host does not, so assign it yourself.
An author can hide or disable commands through BlockDefinition.Navigation. It holds First, Previous, Next, Last, NewRecord, Delete, Query, Execute, Save and Rollback, each a BlockNavigationCommand with Visible and Enabled. A command left null is not authored. An authored Enabled is combined with the live state using AND, so authoring can turn a command off but cannot force it on.
Query by example
EnterQueryModeAsync, ExitQueryModeAsync and ExecuteQueryByExampleAsync(block, criteria), where criteria is a dictionary of field name to QueryCriterion(Value, Operator, IsEnabled). QueryOperator members: Equals, NotEquals, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, Like, NotLike, In, NotIn, Between, IsNull, IsNotNull, StartsWith, EndsWith, Contains.
In query mode, WinFormBlockHost.ExecuteQueryAsync builds the criteria from presenters that allow query and hold a value.
Query templates: SaveQueryTemplate, LoadQueryTemplate, GetQueryTemplates, DeleteQueryTemplate. History: GetQueryHistory, ClearQueryHistory.