Class ListScreenBase<TScreenModel, TRowModel>
- Namespace
- Dynamicweb.CoreUI.Screens
- Assembly
- Dynamicweb.CoreUI.dll
Base class for building list screens in the Dynamicweb back-office UI. Third-party developers subclass either this class or the simpler ListScreenBase<TModel> to create their own list screens.
public abstract class ListScreenBase<TScreenModel, TRowModel> : ScreenBase<TScreenModel> where TScreenModel : DataListViewModel<TRowModel> where TRowModel : DataViewModelBase
Type Parameters
TScreenModelThe screen-level view model that wraps the full list result. Must derive from DataListViewModel<T>.
TRowModelThe per-row view model type rendered as a single list row. Must derive from DataViewModelBase.
- Inheritance
-
ScreenBase<TScreenModel>ListScreenBase<TScreenModel, TRowModel>
- Derived
-
ListScreenBase<TModel>
- Inherited Members
Properties
Configuration
Gets or sets the screen configuration that controls which columns, filters, and
features are active. When null, the framework derives a default configuration
automatically from the screen's overrides. Override in a subclass to supply a
pre-built ListScreenConfiguration.
protected ListScreenConfiguration? Configuration { get; set; }
Property Value
EnableGroupViewToggle
When true, renders a toggle in the list header that lets users switch
between the flat list view and a grouped view.
public bool EnableGroupViewToggle { get; set; }
Property Value
UseGrouping
When true, the list is rendered using the grouping layout defined by
GetListItemGroupID(TRowModel) and GetListItemGroups().
public bool UseGrouping { get; set; }
Property Value
ViewTypeName
Gets or sets the view mapping type name requested for the current screen. A null, empty or unavailable value keeps the configured view. The request is applied only when the configuration allows switching views.
public string? ViewTypeName { get; set; }
Property Value
Methods
CreateMapping<TValue>(Expression<Func<TRowModel, TValue>>)
Creates a ModelMapping for a strongly-typed property on the row model. Use the returned mapping when building a RowViewMapping inside GetViewMappings().
protected ModelMapping CreateMapping<TValue>(Expression<Func<TRowModel, TValue>> expression)
Parameters
expressionExpression<Func<TRowModel, TValue>>A lambda expression that selects the property, e.g.
m => m.Name.
Returns
- ModelMapping
A ModelMapping whose label and system name are derived from the property's
ConfigurablePropertyAttribute.
Type Parameters
TValueThe property value type.
GetAlert()
Returns an Alert displayed prominently on the screen, used for
warnings or notices that require user attention. Called once per render.
Return null (the default) to omit the alert.
protected virtual Alert? GetAlert()
Returns
GetCell(string, TRowModel)
Returns a custom Cell for the specified column and row, allowing
the default cell rendering to be replaced with a custom component.
Called once per cell during list rendering.
Return null (the default) to use the framework's default cell for that column.
protected virtual Cell? GetCell(string propertyName, TRowModel model)
Parameters
propertyNamestringThe system name of the column being rendered.
modelTRowModelThe row model for the row being rendered.
Returns
GetCloseAction()
Returns an action node rendered as the close/back button for the screen.
Called once per render. Return null (the default) to omit the close button.
protected virtual ActionNode? GetCloseAction()
Returns
GetDefinitionInternal()
Builds and returns the raw component tree for this screen.
protected override sealed UiComponentBase GetDefinitionInternal()
Returns
Remarks
Implement this method in every concrete screen class. The result is post-processed by GetDefinition() (injectors, trimming, preset actions) before being returned to the framework.
GetExcludedFilters()
Returns the system names of filters that should be suppressed even if the underlying
query or filter provider would otherwise expose them.
Called once per render before filters are resolved.
Return null (the default) to apply no exclusions.
protected virtual IEnumerable<string>? GetExcludedFilters()
Returns
GetInfoBar()
Returns an InfoBar displayed at the top of the screen, typically used
to show contextual information or status messages. Called once per render.
Return null (the default) to omit the info bar.
protected virtual InfoBar? GetInfoBar()
Returns
GetItemCreateAction()
Returns the primary "create new item" action rendered as a button in the list header.
Called once per render. Only rendered when the current user has Create permission.
Return null (the default) to omit the create button.
protected virtual ActionNode? GetItemCreateAction()
Returns
GetListContextActions()
Returns action groups that operate on multiple selected rows simultaneously
(bulk/multi-select actions). Called once per render.
These are only visible when EnableMultiSelect is true,
which is derived automatically from actions that carry a list command.
Return null (the default) to add no list-level context actions.
protected virtual IEnumerable<ActionGroup>? GetListContextActions()
Returns
GetListData()
Returns the view model containing the list rows that will be rendered.
Called once per render after OnBuildListScreen().
Return null to render an empty list.
protected abstract DataListViewModel<TRowModel>? GetListData()
Returns
- DataListViewModel<TRowModel>
GetListItemContextActions(TRowModel)
Returns the context-menu action groups shown when the user right-clicks or opens
the row actions menu for a single row. Called once per row during list rendering.
Return null (the default) to show no context actions for the row.
protected virtual IEnumerable<ActionGroup>? GetListItemContextActions(TRowModel model)
Parameters
modelTRowModelThe row model for the row being rendered.
Returns
GetListItemGroupID(TRowModel)
Returns the group identifier for a row, used to cluster rows under a shared group
header when UseGrouping is true.
Called once per row during list rendering.
Return null (the default) to place the row in no group.
protected virtual string? GetListItemGroupID(TRowModel model)
Parameters
modelTRowModelThe row model for the row being evaluated.
Returns
GetListItemGroups()
Returns the full set of group definitions that describe each group header rendered
when UseGrouping is true. Called once per render.
Return null (the default) to use no explicit group definitions.
protected virtual IEnumerable<ListItemGroup>? GetListItemGroups()
Returns
GetListItemPrimaryAction(TRowModel)
Returns the primary action triggered when the user clicks a row.
Called once per row during list rendering.
Return null (the default) to make the row non-clickable.
protected virtual ActionBase? GetListItemPrimaryAction(TRowModel model)
Parameters
modelTRowModelThe row model for the row being rendered.
Returns
GetManageAction()
Returns an action node placed in the screen's context action area as the primary
"manage" entry point (e.g. a link to a settings or manage screen).
Called once per render. Return null (the default) to omit the manage action.
protected virtual ActionNode? GetManageAction()
Returns
GetNavigationNodePathProviders()
Returns the NavigationNodePathProvider instances used to build the navigation breadcrumb for TModel.
protected override sealed IEnumerable<NavigationNodePathProvider> GetNavigationNodePathProviders()
Returns
Remarks
Override to supply custom or additional path providers. The default implementation discovers all registered NavigationNodePathProvider<TModel> add-ins.
GetPrimaryListFilter()
Returns an optional primary filter selector rendered in the list toolbar (e.g. a quick "filter by shop"
dropdown). Each option's Action should re-query the list.
Called once per render. Unlike the create actions, this is shown regardless of Create permission.
Return null (the default) to omit the primary filter.
protected virtual Select? GetPrimaryListFilter()
Returns
GetRowSelectable(TRowModel)
Returns whether the given row can be selected by the user (e.g. via a checkbox).
Called once per row during list rendering.
Return true (the default) to make the row selectable.
protected virtual bool GetRowSelectable(TRowModel model)
Parameters
modelTRowModelThe row model for the row being evaluated.
Returns
GetRowSelected(TRowModel)
Returns whether the given row should be pre-selected when the list is initially rendered.
Called once per row during list rendering.
Return false (the default) to render the row as unselected.
protected virtual bool GetRowSelected(TRowModel model)
Parameters
modelTRowModelThe row model for the row being evaluated.
Returns
GetRowStateOptions()
Returns options that control the visual state (e.g. highlighted, disabled, warning)
of rows based on the row model. Called once per render.
Return null (the default) to apply no special row states.
protected virtual RowStateOptions<TRowModel>? GetRowStateOptions()
Returns
- RowStateOptions<TRowModel>
GetScreenActions()
Returns screen-level action groups placed in the top context action area (e.g. toolbar buttons).
Called once per render. Return null (the default) to add no screen actions.
protected virtual IEnumerable<ActionGroup>? GetScreenActions()
Returns
GetScreenExplanation()
Returns an optional explanatory subtitle rendered beneath the list header.
Called once per render. Return null (the default) to omit the subtitle.
protected virtual string? GetScreenExplanation()
Returns
GetScreenName()
Returns the display name shown in the list header and browser title. Called once per render.
protected abstract string GetScreenName()
Returns
GetSecondaryAddAction()
Returns a secondary add action rendered alongside the primary create action.
Called once per render. Only rendered when the current user has Create permission.
Return null (the default) to omit the secondary add button.
protected virtual ActionNode? GetSecondaryAddAction()
Returns
GetSwitchViewAction()
Returns an action that switches between this screen and a related alternative view
(e.g. switching between a list screen and a tree screen for the same data).
Called once per render. Return null (the default) to omit the switch-view action.
protected virtual ActionNode? GetSwitchViewAction()
Returns
GetToolbarActions()
Returns a collection of action nodes rendered in the screen toolbar.
Called once per render. Return null (the default) to add no toolbar actions.
protected virtual IEnumerable<ActionNode>? GetToolbarActions()
Returns
GetViewMappings()
Returns the set of view mappings that define how columns and alternative views
(e.g. thumbnail view) are structured. Called once per render.
Include a RowViewMapping to control column order and labels, and
optionally a ThumbnailViewMapping to enable the thumbnail view toggle.
Return null (the default) to use auto-discovered column mappings from the row model.
protected virtual IEnumerable<ListViewMapping>? GetViewMappings()
Returns
OnBuildListScreen()
Called once at the beginning of each screen render, before columns, filters, and actions are assembled. Override to perform early validation, pre-fetch data, or set properties (such as UseGrouping) that influence the rest of the build pipeline. The base implementation does nothing.
protected virtual void OnBuildListScreen()