method

TextListField.DefaultFrom

Calculate the initial list on the server.

Arguments

ArgumentTypeDescription
callbackDefaultFunc[[]string]A callback receiving operation.DefaultContext and returning operation.Value[[]string] and an error.

Returns

The updated TextListField; the original field is unchanged.

TextListField

How it works

Return operation.Present(values) to supply the list or operation.Empty[[]string]() to supply no default. A returned error stops the save.

This replaces a literal default. Returned items must satisfy normal item, count, and custom validation rules.

Full signature

Related types

  • TextListField

    A configurable list of strings.

  • DefaultFunc

    DefaultFunc supplies a server-side initial value for an eligible omitted field. Root and Siblings are snapshots at initialization; Prior is the persisted enclosing object or stable row (empty for new rows). ID may be empty. Locale is exact and Local retains authorization, cancellation and the active transaction. Present supplies a value, including zero values; Empty leaves it without a default. An error stops the operation. Returned values still pass validation. Defaults do not prefill an unsaved admin form and do not run on ordinary edits to an existing scope. Callbacks must not depend on other dynamic defaults or perform irreversible side effects: separate requests or retries can run again.

Related guides