Table of Contents

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 ViewPaths

The 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 TableRefreshActionAttribute

The TableRefreshActionAttribute instance.

cad ControllerActionDescriptor

The controller action descriptor.

Returns

Task<string>

This method always throws an exception.

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 TableRefreshActionAttribute

The TableRefreshActionAttribute that triggered this filter.

multiSwapViewResult MultiSwapViewResult

The MultiSwapViewResult to update with table component content.

context ResultExecutingContext

The result executing context.

Returns

Task

A completed task as this operation is synchronous.

Exceptions

InvalidOperationException

Thrown when the MultiSwapViewResult has no model set.