Lists of values
LOVDefinition, columns, validation modes and the picker dialogs.
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
A list of values (LOV) lets a person pick a value for a field from a data source.
Registering
manager.LOV.RegisterLOV("Ord", "Qty", new LOVDefinition
{
LOVName = "QtyLov", DataSourceName = "DemoDb",
EntityName = "orderlines", DisplayField = "Qty", ReturnField = "Id",
});
LOVDefinition
| Group | Members |
|---|---|
| Identity | LOVName, Title, DataSourceName, EntityName, DisplayField, ReturnField |
| Lists | Columns, Filters, WhereClause, OrderByClause, RelatedFieldMappings |
| Search | AllowSearch (true), SearchMode (Contains) |
| Display | Width (600), Height (400), AllowMultiSelect, ShowRowNumbers (true), AutoSizeColumns (true) |
| Behavior | AutoRefresh (true), ValidationType (ListOnly), AutoDisplay, AutoDisplayMinChars (2), AutoPopulateRelatedFields (true) |
| Cache | UseCache (true), CacheDurationMinutes (30) |
Fluent members are AddColumn, MapField and AddFilter. Factories are Create and CreateLookup.
LOVSearchMode is Contains, StartsWith, EndsWith or Exact. A LOVColumn has FieldName, DisplayName, Width (100), Visible, Searchable, Format, Alignment (Left, Center, Right), SortOrder and SortAscending. Factories: Create, Hidden, Numeric, Date.
Validation modes
LOVValidationType is ListOnly, Unrestricted or Validated. Only Unrestricted skips the check. An empty value is valid. Otherwise the value is compared, ignoring case, with the values of the ReturnField. When it is not found the message is "Value '{value}' not found in List of Values" with up to five suggestions, and the LOVValidationFailed event is raised.
The LOV manager
ILOVManager offers RegisterLOV, UnregisterLOV, HasLOV, GetLOV, GetBlockLOVs, LoadLOVDataAsync, FilterLOVData, ValidateLOVValueAsync, GetRelatedFieldValues, FindRecordByValueAsync, cache and refresh methods, and the events LOVDataLoaded and LOVValidationFailed.
In the hosts
- F9 shows the list for the current field.
WinFormBlockHost.ShowLovAsync(fieldName, searchText)opensWinFormLovDialog. On WPF the dialog isWpfLovPickerDialog.LovDialogPresenteris a replaceable function, so a host can show its own picker.ApplyLovSelectionAsyncwrites the return value and the related fields. WhenAutoPopulateRelatedFieldsis false the related fields are skipped, but the return value is always set.- Both dialogs use
AllowMultiSelect. The WPF dialog usesShowRowNumbers. The WPF combo presenter usesAutoDisplayandAutoDisplayMinChars.