Virtual Fields
A virtual field is a purely input field whose value may or may not be provided at creation, used to trigger a change in one or more fields that depend on it.
- It must have one or more dependent fields depending on it.
- It must have a validator.
- It may also have a re-validator.
- It may have an
alias- a different field name on the input struct, used in place of the actual field name (only allowed if the corresponding output field is a dependent field that directly depends on this virtual field). - It may have a sanitizer.
- It may leverage
ignore,ignore_initandignore_updateprovision rules. - It may have
on_failureandon_successevent handlers.
Examples
- Validators & re-validators
- With alias name
- With alias name same as dependent
- Required
- Ignore
- Ignore init
- Ignore update
Try it in the browser
virtual_field is a virtual input field. The output dependent uses its value when provided, otherwise
it falls back to a default. Leave virtual_field empty or remove it to see the default.
Loading playground…