UI Control Rendering
uiControlsRenderers.js translates decision-service UI metadata into DOM controls.
It does not decide what to render. The rules do that by returning UI.containers[*].uiControls[*].
Actual Runtime Flow
stepsController.jsexecutes the decision service.- It extracts
result.payload[0](the current UI step model). - It calls
itsUIControlsRenderer.renderUI(containers, baseEl, labelPosition, language, useKui). renderUIloops through containers and controls.renderUIForOneContainerswitches ononeUIControl.typeand calls type-specific renderers such as:renderTextInputrenderTextAreaInputrenderSingleChoiceInputrenderRadioInputrenderMultipleChoicesInput
Control Metadata the Renderer Uses
The renderer relies on control attributes from rules:
type: selects which renderer executes.id: drives DOM IDs, labelforlinkage, and conditional visibility targeting.fieldName: stored as a data attribute sostepsControllercan persist user input.value: default display/selection value.required: rendered asdata-required="true"for client validation.min/max: applied as character limits forTextandTextArea, and numeric bounds forNumber.validationErrorMsg: decision-service message shown under the control.triggeredByControlWithId/triggeredWhenSelection: used to show/hide controls dynamically.
Control Categories
- Simple controls: one DOM input per control (
Text,Number,DateTime,Radiogroup, etc.). - Array controls: dynamic repeated items when
multiple=true(Text,Number,DateTime). - Complex array controls: grouped repeated objects (
MultiExpenses,MultiText). - Data-sourced choice controls: option values fetched from
dataSourceusingdataSourceOptions.
Adding a New Control Type
- Add the new
typeto your vocabulary/rules. - Add a new
caseinrenderUIForOneContainer. - Implement a renderer function that:
- creates DOM elements
- writes
data-fieldNameand any type metadata needed for save/validate - applies
required, defaults, and DS validation message
- Update
stepsControllervalidation/saving logic only if the new control needs special handling.