UI API
Use ToolboxUi for dialogs or popups, and UiPage + UiField for custom pages. We suggest using StateFlow-driven pages and keeping UI logic on the provider side when possible.
ToolboxUI
Check the following Kotlin example:
Use the following best practices:
Refrain from using
runBlockingin UI-related code.Popups are suspending; call from coroutines.
Use
LocalizableStringFactoryfor all user-facing text.
ToolboxUI Components
Use the following components:
showWindow()showUiPage(page),hideUiPage(page)Popups (suspending):
showInfoPopup(header, text|body, okText)showErrorInfoPopup(error)showYesNoPopup(...),showOkCancelPopup(...)showTextInputPopup(header, text, initialText, textType, okText, cancelText)showSnackbar(id, header, text, actionLabel)→ Boolean
All text uses LocalizableString.
UiPage
Check the following example with validations and actions:
Use the following components:
titleFlow: StateFlow<LocalizableString>;fields: StateFlow<List<UiField>>Optional:
iconResource,description,isBusy,isBusyCreatingNewEnvironment,highlightElementId,isCancellable,cancel()Actions:
actionButtons: StateFlow<List<ActionDescription>>,defaultButton: StateFlow<ActionDescription?>Lifecycle:
beforeShow(),afterHide(),setActionErrorNotifier(...)
UiField
Use the following components:
Do not implement directly; Use particular components, that are subclasses of
BaseUiFieldCommon properties:
visibility: StateFlow<Boolean>,modifiers: StateFlow<List<FieldModifier>>
Components (non-exhaustive)
Use the following components:
LabelField,TextField(textType),LinkField,ActionLinkFieldCheckboxField,RadioButtonGroupField,ComboBoxField,RichComboBoxField(V2)SectionFieldd ,RowGroupValidation,ValidatableField,ValidationResult,ValidationErrorFieldAccountDropdownField