method
NumberListField.DefaultFrom
Calculate the initial list on the server.
Arguments
| Argument | Type | Description |
|---|---|---|
callback | DefaultFunc[[]float64] | A callback receiving operation.DefaultContext and returning operation.Value[[]float64] and an error. |
Returns
The updated NumberListField; the original field is unchanged.
NumberListFieldHow it works
Return operation.Present(values) to supply the list or operation.Empty[[]float64]() 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 NumberListField) DefaultFrom(
callback DefaultFunc[[]float64],
) NumberListFieldRelated types
NumberListFieldA configurable list of numbers.
DefaultFuncChoose a field’s initial value on the server using the request, user, locale, or nearby values.