method
TextListField.DefaultFrom
Calculate the initial list on the server.
Arguments
| Argument | Type | Description |
|---|---|---|
callback | DefaultFunc[[]string] | A callback receiving operation.DefaultContext and returning operation.Value[[]string] and an error. |
Returns
The updated TextListField; the original field is unchanged.
TextListFieldHow 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
func (f TextListField) DefaultFrom(callback DefaultFunc[[]string]) TextListFieldRelated types
TextListFieldA configurable list of strings.
DefaultFuncChoose a field’s initial value on the server using the request, user, locale, or nearby values.