Value Mapping
VibeFlui maps row data into form values with mapRowToFormValues.
Create values
Create mode uses createValueMode, which defaults to "empty".
| Mode | Behavior |
|---|---|
empty | Uses the empty value for the field type. |
default | Uses defaultValue, or the field type empty value. |
hidden | Excludes the field from mapped values and rendering. |
TS
{
name: "status",
type: "select",
createValueMode: "default",
defaultValue: "active"
}Edit values
Edit mode uses editValueMode, which defaults to "fromRow".
| Mode | Behavior |
|---|---|
fromRow | Reads from valueFrom or name. |
empty | Uses the empty value for the field type. |
default | Uses defaultValue, or the field type empty value. |
hidden | Excludes the field from mapped values and rendering. |
TS
{
name: "password",
type: "password",
createValueMode: "empty",
editValueMode: "empty",
helperText: "Leave empty on edit to keep the current password."
}valueFrom
Use valueFrom when the backend row shape differs from the submit payload shape.
TS
{
name: "roleId",
label: "Role",
type: "select",
valueFrom: "role.id"
}Given this row:
JSON
{
"id": "usr_001",
"role": {
"id": "admin",
"name": "Administrator"
}
}The form value becomes:
JSON
{
"roleId": "admin"
}Empty values by type
| Type | Empty value |
|---|---|
checkbox, switch | false |
multiselect, checkbox-group, tags | [] |
number, range | "" |
hidden, file, image | undefined |
| all other types | "" |
View mode
The detail view path uses edit-style mapping so values come from the row by default.