Class ListingPageBase<TPageConfiguration, TClientProperties>
Listing page for defining a table and providing a data set.
[UIEvaluatePermission("View")]
public abstract class ListingPageBase<TPageConfiguration, TClientProperties> : Page<TClientProperties>, IPage where TPageConfiguration : ListingConfiguration where TClientProperties : ListingTemplateClientProperties, new()
Type Parameters
TPageConfigurationTClientProperties
- Inheritance
-
objectPage<TClientProperties>ListingPageBase<TPageConfiguration, TClientProperties>
- Implements
- Derived
-
ListingPageBase<TPageConfiguration>ListingPage<TClientProperties>
- Inherited Members
- Extension Methods
Remarks
Only use this class if you need to define a custom client properties class.
Constructors
ListingPageBase()
Initializes a new instance of the ListingPageBase<TPageConfiguration> class.
protected ListingPageBase()
Properties
PageConfiguration
Page configuration.
public abstract TPageConfiguration PageConfiguration { get; set; }
Property Value
- TPageConfiguration
Methods
Change(FormSubmissionCommandArguments, CancellationToken)
Handles the form change command. The command is invoked whenever visibility conditions or form component configurators of the form need to be reevaluated to re-render the form.
[PageCommand(Permission = "View")]
public Task<ICommandResponse<FilterFormChangeResult>> Change(FormSubmissionCommandArguments args, CancellationToken cancellationToken = default)
Parameters
argsFormSubmissionCommandArgumentsForm change arguments.
cancellationTokenCancellationTokenCancellation instruction.
Returns
ComponentCommand(FormComponentCommandModel, CancellationToken)
Handles the form component command invocation.
[PageCommand]
public virtual Task<object> ComponentCommand(FormComponentCommandModel commandModel, CancellationToken cancellationToken)
Parameters
commandModelFormComponentCommandModelForm component command arguments.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
- Task<object>
Returns the form component command result.
ConfigureTemplateProperties(TClientProperties)
Gets the object representing client side template properties.
public override Task<TClientProperties> ConfigureTemplateProperties(TClientProperties properties)
Parameters
propertiesTClientPropertiesInitialized properties object.
Returns
- Task<TClientProperties>
ExportListingData(ListingExportCommandArguments, CancellationToken)
Exports the data corresponding to the current listing state described by the args (filter,
search term, sorting) into a file downloaded by the client.
[PageCommand]
public Task<ICommandResponse<ListingExportResult>> ExportListingData(ListingExportCommandArguments args, CancellationToken cancellationToken)
Parameters
argsListingExportCommandArgumentsExport command arguments provided by the client.
cancellationTokenCancellationTokenCancellation token.
Returns
Remarks
The export is available only when it is enabled for the page via ExportConfiguration and the page provides the listing data (ListingPage<TClientProperties>, DataContainerListingPage). The Permission is evaluated within the command, so that the command itself does not have to declare a permission that every application containing a listing page would need to define, and so that the same command works in applications scoped to a workspace, where commands must not declare permissions.
Unlike LoadData(LoadDataSettings, CancellationToken), the data is not paginated, i.e. the whole result set is exported and held in memory while the file is being built.
Exceptions
- InvalidOperationException
Thrown when the export is not enabled for the page, or the page type does not provide the listing data.
- ForbiddenAccessException
Thrown when the current user is not granted the permission required by the export.
GetFilterFormComponentsContext()
Gets the form component context for the form components.
protected virtual Task<IFormContext> GetFilterFormComponentsContext()
Returns
- Task<IFormContext>
LoadData(LoadDataCommandArguments, CancellationToken)
Returns result containing data and the number of total items.
[PageCommand(Permission = "View")]
public Task<ICommandResponse<LoadDataResult>> LoadData(LoadDataCommandArguments args, CancellationToken cancellationToken)
Parameters
argsLoadDataCommandArgumentsCommand arguments provided by client.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<ICommandResponse<LoadDataResult>>
LoadData(LoadDataSettings, CancellationToken)
Returns LoadDataResult containing data and the number of total items.
protected abstract Task<LoadDataResult> LoadData(LoadDataSettings settings, CancellationToken cancellationToken)
Parameters
settingsLoadDataSettingsLoad data settings.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<LoadDataResult>