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

    Choose a field’s initial value on the server using the request, user, locale, or nearby values.

Related guides