Table of Contents

Class FieldModel

Namespace
The.Web.Entities
Assembly
Instagile.Web.Client.dll

The resolved, ready-to-render form of a FieldSpec - component, label, height, validation, visibility/editability and the read-access gate - produced by CreateModel(FieldContext) and consumed by the edit components. The edit-view analog of ColumnModel.

public sealed record FieldModel : IEquatable<FieldModel>
Inheritance
FieldModel
Implements
Inherited Members

Constructors

FieldModel(PropertyBinding, Type, Type?, string?, string?, Func<FieldContext, FieldModel, FieldHeight>, int?, PredicateResult, PredicateResult, IEnumerable<IFieldParameter>, bool)

public FieldModel(PropertyBinding binding, Type componentType, Type? labelComponentType, string? label, string? helpText, Func<FieldContext, FieldModel, FieldHeight> getRows, int? maxLength, PredicateResult visibility, PredicateResult editability, IEnumerable<IFieldParameter> parameters, bool isAdminOnly = false)

Parameters

binding PropertyBinding
componentType Type
labelComponentType Type
label string
helpText string
getRows Func<FieldContext, FieldModel, FieldHeight>
maxLength int?
visibility PredicateResult
editability PredicateResult
parameters IEnumerable<IFieldParameter>
isAdminOnly bool

Properties

Binding

public PropertyBinding Binding { get; init; }

Property Value

PropertyBinding

ComponentType

public Type ComponentType { get; init; }

Property Value

Type

Editability

public PredicateResult Editability { get; init; }

Property Value

PredicateResult

ExtraParameters

public IFieldParameter[] ExtraParameters { get; init; }

Property Value

IFieldParameter[]

GetRows

public Func<FieldContext, FieldModel, FieldHeight> GetRows { get; init; }

Property Value

Func<FieldContext, FieldModel, FieldHeight>

HelpText

public string? HelpText { get; init; }

Property Value

string

IsAdminOnly

public bool IsAdminOnly { get; init; }

Property Value

bool

IsReadOnly

public bool IsReadOnly { get; }

Property Value

bool

IsVisible

public bool IsVisible { get; }

Property Value

bool

Label

public string? Label { get; init; }

Property Value

string

LabelComponentType

public Type? LabelComponentType { get; init; }

Property Value

Type

MaxLength

public int? MaxLength { get; init; }

Property Value

int?

ReadAccessRequired

Entity type whose read permission gates this field, or null when ungated. Set from the field's RowSpec; enforced by the edit components via IsReadableBy(IPrincipal).

public IEntityInfo? ReadAccessRequired { get; init; }

Property Value

IEntityInfo

Visibility

public PredicateResult Visibility { get; init; }

Property Value

PredicateResult

Methods

IsReadableBy(IPrincipal)

Whether principal has the read access this field requires - always true when the field is ungated. Combined with IsVisible and the admin checks by the edit components.

public bool IsReadableBy(IPrincipal principal)

Parameters

principal IPrincipal

Returns

bool

ResolveHeight(FieldContext)

Final height, modified for low-density vertical labelling.

public FieldHeight ResolveHeight(FieldContext context)

Parameters

context FieldContext

Returns

FieldHeight