Class TableOobRefreshFilter
- Namespace
- Htmx.Components.Table.Internal
- Assembly
- Htmx.Components.dll
Internal result filter that processes table refresh actions to provide comprehensive out-of-band updates for all table components. This filter is automatically applied to controller actions marked with TableRefreshActionAttribute.
public class TableOobRefreshFilter : OobResultFilterBase<TableRefreshActionAttribute>, IAsyncResultFilter, IFilterMetadata
- Inheritance
-
TableOobRefreshFilter
- Implements
- Inherited Members
- Extension Methods
Remarks
This filter performs out-of-band updates for all major table components including the table body, header, pagination, action list, and edit state. It's designed exclusively for HTMX requests and will throw an exception if used with non-HTMX requests. The filter ensures that all table-related UI elements are refreshed after operations that may affect the table's data or state.
Constructors
TableOobRefreshFilter(ViewPaths)
Initializes a new instance of the TableOobRefreshFilter class.
public TableOobRefreshFilter(ViewPaths viewPaths)
Parameters
viewPaths
ViewPathsThe view paths configuration for resolving table component views.
Methods
GetViewNameForNonHtmxRequest(TableRefreshActionAttribute, ControllerActionDescriptor)
Throws an InvalidOperationException as this filter is designed exclusively for HTMX requests. Table refresh operations require HTMX's out-of-band update capabilities and cannot be handled through traditional full page renders.
protected override Task<string?> GetViewNameForNonHtmxRequest(TableRefreshActionAttribute attribute, ControllerActionDescriptor cad)
Parameters
attribute
TableRefreshActionAttributeThe TableRefreshActionAttribute instance.
cad
ControllerActionDescriptorThe controller action descriptor.
Returns
Exceptions
- InvalidOperationException
Always thrown as this filter doesn't support non-HTMX requests.
UpdateMultiSwapViewResultAsync(TableRefreshActionAttribute, MultiSwapViewResult, ResultExecutingContext)
Updates the MultiSwapViewResult with comprehensive table component refreshes. This method adds out-of-band updates for all major table components to ensure the entire table UI reflects any changes that occurred during processing.
protected override Task UpdateMultiSwapViewResultAsync(TableRefreshActionAttribute attribute, MultiSwapViewResult multiSwapViewResult, ResultExecutingContext context)
Parameters
attribute
TableRefreshActionAttributeThe TableRefreshActionAttribute that triggered this filter.
multiSwapViewResult
MultiSwapViewResultThe MultiSwapViewResult to update with table component content.
context
ResultExecutingContextThe result executing context.
Returns
- Task
A completed task as this operation is synchronous.
Exceptions
- InvalidOperationException
Thrown when the MultiSwapViewResult has no model set.