Sets the value of the current field in editable field scenarios such as JSField and JSItem. Combined with ctx.getValue(), it enables two-way binding with the form.
| Scenario | Description |
|---|---|
| JSField | Write user-selected or calculated values into editable custom fields. |
| JSItem | Update the current cell value in editable items of tables/sub-tables. |
| JSColumn | Update the field value of the corresponding row based on logic during table column rendering. |
Note:
ctx.setValue(v)is only available in RunJS contexts with form binding. It is not available in scenarios without field binding, such as FlowEngine, linkage rules, or JSBlock. It is recommended to use optional chaining before use:ctx.setValue?.(value).
value is the field value to be written. The type is determined by the form item type of the field.ctx.setValue(v) updates the value of the current field in the Ant Design Form and triggers related form linkage and validation logic.ctx.getValue() to confirm the write result.ctx.setValue may be undefined. It is recommended to use ctx.setValue?.(value) to avoid errors.{ id, [titleField]: label }), depending on the specific field configuration.js-field:value-change - A container event triggered when an external value changes, used to update the display.