Class EditPageBase
Represents base edit page.
public abstract class EditPageBase : Page<EditTemplateClientProperties>, IPage
- Inheritance
-
objectEditPageBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
EditPageBase(IFormDataBinder)
Initializes an instance of the EditPageBase class.
protected EditPageBase(IFormDataBinder formDataBinder)
Parameters
formDataBinder
IFormDataBinder
Properties
FormDataBinder
Gets the binder for form data.
protected IFormDataBinder FormDataBinder { get; }
Property Value
FormItemCollectionProvider
Returns form item collection provider from service collection.
protected IFormItemCollectionProvider FormItemCollectionProvider { get; init; }
Property Value
- IFormItemCollectionProvider
PageConfiguration
Page configuration.
public EditConfiguration PageConfiguration { get; set; }
Property Value
RefetchAll
Indicates whether to refetch all templates on edit.
protected virtual bool RefetchAll { get; }
Property Value
- bool
UIPermissionEvaluator
Gets the current permission evaluator.
[Obsolete("The member is deprecated and will be removed in the next version.")]
[ObsoleteSince(30, 0)]
protected IUIPermissionEvaluator UIPermissionEvaluator { get; }
Property Value
Methods
BindContextToComponents(ICollection<IFormComponent>)
Binds context to form components.
protected Task BindContextToComponents(ICollection<IFormComponent> components)
Parameters
components
ICollection<IFormComponent>Form components.
Returns
- Task
Change(FormChangeCommandArguments)
Handles the form change command. The command is invoked whenever visibility conditions of the form need to be reevaluated to re-render the form.
public virtual Task<ICommandResponse<FormChangeResult>> Change(FormChangeCommandArguments args)
Parameters
args
FormChangeCommandArgumentsForm change arguments.
Returns
- Task<ICommandResponse<FormChangeResult>>
Returns the form change result.
ComponentCommand(FormComponentCommandModel, CancellationToken)
Handles the form component command invocation.
public virtual Task<object> ComponentCommand(FormComponentCommandModel commandModel, CancellationToken cancellationToken)
Parameters
commandModel
FormComponentCommandModelForm component command arguments.
cancellationToken
CancellationTokenThe cancellation instruction.
Returns
- Task<object>
Returns the form component command result.
ConfigurePage()
Set up page's configuration. Configures the submit action.
public override Task ConfigurePage()
Returns
- Task
ConfigureTemplateProperties(EditTemplateClientProperties)
Transforms the configuration to template properties.
public override Task<EditTemplateClientProperties> ConfigureTemplateProperties(EditTemplateClientProperties properties)
Parameters
properties
EditTemplateClientProperties
Returns
Remarks
Performs also permission evaluation.
EvaluatePagePermission<TEvaluationResult>(EditTemplateClientProperties, string, Func<string, Task<TEvaluationResult>>)
Evaluates the given permission for the current page. If the user has not the proper permission, the page is disabled.
protected Task<TEvaluationResult> EvaluatePagePermission<TEvaluationResult>(EditTemplateClientProperties properties, string permission, Func<string, Task<TEvaluationResult>> evaluatePermission) where TEvaluationResult : PermissionEvaluationResult
Parameters
properties
EditTemplateClientPropertiesEdit template client properties.
permission
stringPermission to evaluate.
evaluatePermission
Func<string, Task<TEvaluationResult>>Function used for evaluating the permission.
Returns
- Task<TEvaluationResult>
Type Parameters
TEvaluationResult
GetConfirmationDialogFormItems(Type)
Returns form items for confirmation dialog.
protected Task<ICollection<IFormItem>> GetConfirmationDialogFormItems(Type modelType)
Parameters
modelType
Type
Returns
- Task<ICollection<IFormItem>>
Returns the collection of confirmation dialog form items.
Remarks
The data of the form is not bound in this phase. State of the form components can be modified here.
GetFormItems()
Returns form items for editing object.
protected abstract Task<ICollection<IFormItem>> GetFormItems()
Returns
- Task<ICollection<IFormItem>>
Returns the collection of form items.
Remarks
The data of the form is not bound in this phase. State of the form components can be modified here.
GetFormItemsClientProperties()
Returns properties describing client form items for editing object.
protected abstract Task<IEnumerable<IFormItemClientProperties>> GetFormItemsClientProperties()
Returns
- Task<IEnumerable<IFormItemClientProperties>>
Remarks
The value of the form item can be modified here.
GetPagePermissionEvaluator()
Gets the permission evaluator for the current page.
protected virtual Task<Func<string, Task<PermissionEvaluationResult>>> GetPagePermissionEvaluator()
Returns
- Task<Func<string, Task<PermissionEvaluationResult>>>
Remarks
Default implementation uses the IUIPermissionEvaluator.
GetValidatedConfirmationModel<T>()
Returns validate confirmation model parsed in the Submit(FormSubmissionCommandArguments) method.
protected T GetValidatedConfirmationModel<T>() where T : class
Returns
- T
Type Parameters
T
InitializeContext()
Initializes form context.
protected virtual Task<IFormContext> InitializeContext()
Returns
- Task<IFormContext>
Submit(FormSubmissionCommandArguments)
Handles the form submit command.
public virtual Task<ICommandResponse> Submit(FormSubmissionCommandArguments args)
Parameters
args
FormSubmissionCommandArgumentsForm submission arguments.
Returns
- Task<ICommandResponse>
Returns the form submission result.
Remarks
The default implementation calls the SubmitInternal(FormSubmissionCommandArguments, ICollection<IFormItem>, IFormFieldValueProvider) method.
- See Also
SubmitInternal(FormSubmissionCommandArguments, ICollection<IFormItem>, IFormFieldValueProvider)
Handles the internal specific processing of form submit command.
protected abstract Task<ICommandResponse> SubmitInternal(FormSubmissionCommandArguments args, ICollection<IFormItem> items, IFormFieldValueProvider formFieldValueProvider)
Parameters
args
FormSubmissionCommandArgumentsForm submission arguments.
items
ICollection<IFormItem>Form items with bound component values.
formFieldValueProvider
IFormFieldValueProviderProvider of form field values.
Returns
- Task<ICommandResponse>
Returns the form submission result.
Remarks
This method is called by the default implementation of the Submit(FormSubmissionCommandArguments) method.
- See Also