Form View
Form view components for the Daitum UI framework.
This module provides comprehensive form-building capabilities through the FormView class
and a rich collection of form elements. Forms are structured layouts for data entry,
editing, and display, organised in a flexible grid-based system with powerful data
binding and validation features.
- Enums:
FormSize: Element sizing (EXTRA_SMALL, SMALL, MEDIUM, LARGE, EXTRA_LARGE, FIT_WIDTH)FormVariant: Label styling variants (REGULAR, HEADER)FormResize: Text area resize behaviour (NONE, BOTH, HORIZONTAL, VERTICAL)FormIconSet: Icon catalogue for icon pickers (ALL, DAITUM, FONT_AWESOME, FA_PRO)
- Classes:
FormElement: Base class for all form elements with layout and validationFormView: Container view managing form layout and elementsFormLabel,FormTextInput,FormNumberInput,FormBasicTextArea: Text elementsFormCheckbox,FormSlider,FormIconCheckbox: Boolean input elementsFormDropdown: Object selection elementFormDatePicker,FormTimePicker,FormDateTimePicker: Date/time elementsFormButton: Action button elementFormReviewRating: Rating input elementFormColourPickerInput: Colour (hex) picker elementFormIconPicker: Icon selection picker elementFormLink: Hyperlink element navigating to an external destination (e.g. model editor)
Example:
builder = UiBuilder()
form = builder.add_form_view(
display_name="Customer Details",
total_rows=6,
table=customers_table,
match_row=MatchRowFilterMode.FIRST_ROW,
)
form.set_columns(num_columns=2, width="250px")
# Header label spanning both columns
header = form.add_label("Customer Information", row=1, column=1)
header.set_column_span(2).set_variant(FormVariant.HEADER).set_size(FormSize.LARGE)
# Text inputs
form.add_label("Name:", row=2, column=1)
form.add_text_input(customers_table.name_field, row=2, column=2)
# Number input with range validation
form.add_label("Age:", row=3, column=1)
age_input = form.add_number_input(customers_table.age_field, row=3, column=2)
age_input.set_range_validation(min_value=IntegerValue(18), max_value=IntegerValue(120))
- class FormView(display_name=None, hidden=False, total_rows=None, table=None, match_row=None)[source]
Bases:
BaseViewRepresents a structured form layout for displaying and editing data.
A FormView arranges UI elements such as text fields, numeric inputs, dropdowns, checkboxes, date/time pickers, and buttons in a vertical, form-like layout. It can be bound to a source table, allowing for dynamic data depending on the specified table row.
- total_rows
The number of rows in the form layout.
- Type:
Optional[int]
- source_table
The ID of the source table, if provided.
- Type:
Optional[str]
- form_columns
Column layout definitions for the form.
- Type:
Optional[List[_FormColumn]]
- form_elements
The interactive components within the form.
- Type:
List[FormElement]
- match_row_filter_mode
A MatchRowFilterMode object holding a context variable which refers to the row of the provided source table to retrieve data from.
- Type:
Optional[MatchRowFilterMode]
- set_total_rows(rows)[source]
Sets the total number of rows in the form layout.
- Return type:
FormView
- set_table(table, match_row=None)[source]
Sets the source data table and optional row-matching mode for this form.
- Return type:
FormView
- add_column(width)[source]
Add a column to the form view with the specified width.
- Parameters:
width (
str) – The CSS compatible width of the column, e.g., “100px”, “20%”, “min-content”.
- set_columns(num_columns, width)[source]
Defines a fixed number of columns in the form layout, all with the same width.
This replaces any existing columns. Each column is assigned the same CSS-compatible width value, such as “150px”, “25%”, or “min-content”.
- add_label(text, row, column)[source]
Adds a static or data-bound label element to the form at a specific grid position.
The label can display either a fixed string or a bound variable (field, parameter, or calculation). It is placed according to the specified row and column. Use the returned element’s setters to configure row_span, column_span, horizontal_alignment, size, variant, and reference_field.
- Parameters:
- Returns:
The label element created and added to the form.
- Return type:
FormLabel
- add_text_input(text, row, column)[source]
Adds a text input field to the form, bound to a string-based variable.
This input allows users to view and edit text data from a field, parameter, or calculation. Use the returned element’s attributes to set row_span, column_span, horizontal_alignment, and size.
- Parameters:
- Returns:
The input element created and added to the form.
- Return type:
FormTextInput
- add_slider(value, row, column)[source]
Adds a slider input to the form, bound to a boolean variable.
Typically used for toggle-style input where a slider UI is preferred over a checkbox. Use the returned element’s setters to configure horizontal_alignment and size.
- Parameters:
- Returns:
The slider element created and added to the form.
- Return type:
FormSlider
- add_check_box(value, row, column)[source]
Adds a checkbox input to the form, bound to a boolean variable.
Used for simple on/off or true/false input. Use the returned element’s setters to configure horizontal_alignment and size.
- Parameters:
- Returns:
The checkbox element created and added to the form.
- Return type:
FormCheckbox
- add_icon_check_box(value, row, column)[source]
Adds an icon-based checkbox to the form, bound to a boolean variable.
Instead of a standard checkbox, this component displays custom icons for the checked (on_icon) and unchecked (off_icon) states. Useful for visually enhanced toggle inputs. Set off_icon, horizontal_alignment, and size on the returned element.
- Parameters:
- Returns:
The icon checkbox element created and added to the form.
- Return type:
FormIconCheckbox
- add_drop_down(value, row, column)[source]
Adds a dropdown input to the form, bound to an object-type variable.
This component allows selection from a list of object references. The display label for each choice defaults to the table’s key column; use the returned element’s
set_display_field()setter to override. Also use setters foris_searchable,choices,row_span,column_span,horizontal_alignment, andsize.- Parameters:
- Raises:
TypeError – If the bound variable is not an object type or is an array.
- Returns:
The dropdown element created and added to the form.
- Return type:
FormDropdown
- add_date_time(value, row, column, reference_field=None)[source]
Adds a date, time, or datetime picker to the form, based on the bound variable’s type.
The type of picker is automatically chosen depending on whether the data source is of type DATE, TIME, or DATETIME. Set
display_format,with_selector,horizontal_alignment,size, andtime_intervaldirectly on the returned element.- Parameters:
value (
Field|Parameter|Calculation) – The variable to bind the picker to. Must be of type DATE, TIME, DATETIME or OBJECT (reference_field required).row (
int) – The row position of the picker.column (
int) – The column position of the picker.reference_field (
str|None) – If provided, it is assumed that the value is of OBJECT type, and the reference field is the field in the reference table to display.
- Raises:
ValueError – If the provided variable is not of type DATE, TIME, or DATETIME.
- Returns:
- The appropriate date/time picker element (FormDatePicker,
FormTimePicker, or FormDateTimePicker).
- Return type:
FormElement
- add_number_input(value, row, column)[source]
Adds a numeric input field to the form, bound to an integer or decimal variable.
This component allows the user to enter or edit a numeric value. Set
row_span,column_span,display_format,horizontal_alignment, andsizedirectly on the returned element.- Parameters:
- Raises:
TypeError – If the bound variable is not of type INTEGER or DECIMAL.
- Returns:
The number input element created and added to the form.
- Return type:
FormNumberInput
- add_text_area(text, row, column)[source]
Adds a multiline text area input to the form, bound to a string variable.
The text area allows users to input or edit longer blocks of text. Set
row_span,column_span,rows,resize,horizontal_alignment, andsizedirectly on the returned element.- Parameters:
- Returns:
The configured text area element added to the form.
- Return type:
FormBasicTextArea
- add_button(text, on_click, row, column)[source]
Adds a clickable button element to the form layout.
- Parameters:
- Returns:
- The button element added to the form. Set
row_spanand column_spandirectly on the returned element. Use set_* methods to configure appearance (text_color, background_color, icon_source, icon_color, size, horizontal_alignment).
- The button element added to the form. Set
- Return type:
FormButton
- add_review_rating(value, row, column)[source]
Adds a review rating element to the form layout.
- Parameters:
- Returns:
- The review rating element added to the form. Set
row_span, column_span,horizontal_alignment,size,fill_icon,empty_icon, andfill_colordirectly on the returned element.
- The review rating element added to the form. Set
- Return type:
FormReviewRating
- add_colour_picker_input(value, row, column)[source]
Adds a colour picker to the form, bound to a string variable (e.g. hex colour).
Use the returned element’s setters to configure row_span, column_span, horizontal_alignment, size, swatch_colours, and allow_custom.
- Parameters:
- Returns:
The element added to the form.
- Return type:
FormColourPickerInput- Raises:
ValueError – If the bound variable is not of type
STRING.
- add_icon_picker(value, row, column)[source]
Adds an icon picker to the form, bound to a string variable (icon identifier).
Use the returned element’s setters to configure icon_set, row_span, column_span, horizontal_alignment, size, defaults, and preview_color.
- Parameters:
- Returns:
The element added to the form.
- Return type:
FormIconPicker- Raises:
ValueError – If the bound variable is not of type
STRING.
- add_model_editor_link(row, column, model_id, scenario_id=None, text_value='Open Model', open_new_tab=False)[source]
Adds a hyperlink element to the form that opens the Daitum model editor.
model_idis required and must be an integer-typed value.scenario_idis optional; when provided it identifies the scenario to pre-select within the model. BothFieldvalues must belong to the form’s source table.- Parameters:
row (
int) – Starting row position in the form grid.column (
int) – Starting column position in the form grid.model_id (
Field|Parameter|Calculation) – Integer value identifying the model to open. Must be of typeINTEGER.text_value (
str) – The visible label of the link. Defaults to"Open Model".scenario_id (
Field|Parameter|Calculation|None) – Integer value identifying the scenario to open within the selected model. Must be of typeINTEGER. Optional.open_new_tab (
bool) – IfTrue, the editor opens in a new browser tab. Defaults toFalse.
- Raises:
ValueError – If
model_idorscenario_idis aFieldnot present in the form’s source table, or if either value is not of typeINTEGER.- Returns:
The link element created and added to the form.
- Return type:
FormLink
- class FormSize(*values)[source]
Bases:
EnumDefines the standard size options for form elements, controlling their overall scale and layout footprint.
- EXTRA_SMALL
Extra small size, for very compact UI elements.
- SMALL
Small size, slightly larger than extra small.
- MEDIUM
Medium size, the default and most commonly used size.
- LARGE
Large size, for elements that require more prominence.
- EXTRA_LARGE
Extra large size, for very prominent or attention-grabbing elements.
- FIT_WIDTH
Adjusts the element to fit the width of its container.
- EXTRA_SMALL = 'EXTRA_SMALL'
- SMALL = 'SMALL'
- MEDIUM = 'MEDIUM'
- LARGE = 'LARGE'
- EXTRA_LARGE = 'EXTRA_LARGE'
- FIT_WIDTH = 'FIT_WIDTH'
- class FormVariant(*values)[source]
Bases:
EnumDefines visual style variants for form labels.
- REGULAR
Standard styling.
- HEADER
Styling intended for header or section titles within forms.
- REGULAR = 'REGULAR'
- HEADER = 'HEADER'
- class FormResize(*values)[source]
Bases:
EnumControls the resize behavior of resizable elements such as text areas.
- Members:
- NONE:
The element is not resizable by the user.
- BOTH:
The element can be resized both horizontally and vertically.
- HORIZONTAL:
The element can be resized horizontally only.
- VERTICAL:
The element can be resized vertically only.
- NONE = 'NONE'
- BOTH = 'BOTH'
- HORIZONTAL = 'HORIZONTAL'
- VERTICAL = 'VERTICAL'
- class FormIconSet(*values)[source]
Bases:
EnumCatalogue of icons exposed by
FormIconPicker.Values match the portal
IconPicker/ modelv3FormIconPicker.IconSetenum.- ALL = 'ALL'
- DAITUM = 'DAITUM'
- FONT_AWESOME = 'FONT_AWESOME'
- FA_PRO = 'FA_PRO'
Form Elements
Form elements are interactive components that can be placed inside a
FormView. All form_view elements inherit from FormElement.
- class FormElement(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None)[source]
Bases:
BaseElementAbstract base class representing a UI form element with data binding, layout, styling, and state management capabilities.
- data_source_id
Reference to the data source variable backing this element’s value.
- Type:
Optional[ModelVariable]
- data_source_object_field_reference
If the data source is of OBJECT type, this contains the reference field.
- Type:
Optional[str]
- row_start
Starting grid row index of the element in the form layout.
- Type:
- column_start
Starting grid column index of the element in the form layout.
- Type:
- row_span
Number of rows the element spans.
- Type:
- column_span
Number of columns the element spans.
- Type:
- horizontal_alignment
Horizontal alignment of the element within its grid cell.
- Type:
daitum_ui.styles.HorizontalAlignment
- size
Visual size category of the element (e.g., small, medium, large).
- Type:
Optional[FormSize]
- default_value_reference
Reference to a default value used by the element if no explicit data is bound.
- Type:
Optional[DefaultValueReference]
- data_validation_rule
Validation rules applied to user input on this element.
- Type:
Optional[DataValidationRule]
- tooltip_field
The field ID or named value ID containing the value to display in the tooltip.
- Type:
Optional[str]
- data_source_id: ModelVariable | None = None
- row_start: int = 0
- column_start: int = 0
- row_span: int = 1
- column_span: int = 1
- horizontal_alignment: HorizontalAlignment = 'LEFT'
- size: FormSize | None = None
- default_value_reference: DefaultValueReference | None = None
- data_validation_rule: DataValidationRule | None = None
- set_default_value_reference(value, behaviour=DefaultValueBehaviour.DEFAULT)[source]
Set the default value reference for this field.
This configures a reference value that can be used to reset the field’s value to a predefined default. The reference can either be another field or a named value, with an associated behaviour determining how the reset behaves in the UI.
- Parameters:
value (
Field|Parameter|Calculation) – The source of the default value. If a Field instance, the reference type is set to FIELD; otherwise, to a NAMED_VALUE.behaviour (
DefaultValueBehaviour) – Controls the behavior of the default value override.
- Return type:
FormElement
- set_list_validation(reference_field)[source]
Sets a list-based data validation rule restricting input to values from a referenced field list.
- Parameters:
reference_field (
str) – Name of the field that provides the allowed list of valid values for this input.- Raises:
ValueError – If called on an unsupported element type. Supported types are FormNumberInput, FormDatePicker, FormTimePicker, FormDateTimePicker and FormDropdown.
- Return type:
FormElement
- set_range_validation(min_value=None, max_value=None, flag=ValidationFlag.INCLUSIVE)[source]
Sets a numeric range validation rule limiting input values to a specified range.
- Parameters:
min_value (
str|Value|None) – The minimum allowed value. If an int or float, it isstring (taken to be the literal max value. If a)
to (it is assumed to be a reference)
value. (a field or named value specifying the max)
max_value (
str|Value|None) – The maximum allowed value. If an int or float, it isstring
to
value.
flag (
ValidationFlag) – Specifies if the range bounds are inclusive or exclusive. Defaults to ValidationFlag.INCLUSIVE.
- Raises:
ValueError – If called on an unsupported element type. Supported types are FormNumberInput, FormDatePicker, FormTimePicker and FormDateTimePicker.
- Return type:
FormElement
- set_horizontal_alignment(alignment)[source]
Sets the horizontal alignment of the element within its grid cell.
- Parameters:
alignment (
HorizontalAlignment) – The desired horizontal alignment.- Return type:
FormElement
- set_display_format(display_format)[source]
Sets the display format for editable elements.
- Return type:
FormElement
- set_size(size)[source]
Sets the visual size of this element.
- Return type:
FormElement
- set_row_span(n)[source]
Sets the number of rows this element spans.
- Return type:
FormElement
- set_column_span(n)[source]
Sets the number of columns this element spans.
- Return type:
FormElement
- set_reference_field(field)[source]
Sets the reference field for OBJECT-type data sources.
- Return type:
FormElement
- set_tooltip_field(field)[source]
Sets the field ID or named value ID to use as the tooltip text.
- Return type:
FormElement
- class FormLabel(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, display_string=None, variant=FormVariant.REGULAR)[source]
Bases:
FormElementA static or data-bound text label within a form.
Displays a fixed string or a value bound to a field, parameter, or calculation. Use
variantto control visual weight (REGULARfor body text,HEADERfor section headings).- variant: FormVariant = 'REGULAR'
- set_variant(variant)[source]
Sets the visual variant of the label.
- Return type:
FormLabel
- class FormTextInput(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, default_value=None)[source]
Bases:
FormElementA single-line text input bound to a
STRINGfield, parameter, or calculation.- default_value
Optional default text pre-filled when the bound value is absent.
- Type:
StringValue | None
- default_value: StringValue | None = None
- class FormNumberInput(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, default_value=None)[source]
Bases:
FormElementA numeric input bound to an
INTEGERorDECIMALfield, parameter, or calculation.Supports range validation via
FormElement.set_range_validation().- default_value
Optional numeric default pre-filled when the bound value is absent.
- Type:
IntegerValue | DecimalValue | None
- default_value: IntegerValue | DecimalValue | None = None
- class FormBasicTextArea(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, default_value=None, rows=1, resize=FormResize.NONE)[source]
Bases:
FormElementA multiline text area bound to a
STRINGfield, parameter, or calculation.- default_value
Optional default text.
- Type:
StringValue | None
- rows
Initial visible row count. Defaults to
1.- Type:
- resize
User-resizability direction. Defaults to
NONE.- Type:
FormResize
- default_value: StringValue | None = None
- rows: int = 1
- resize: FormResize = 'NONE'
- class FormCheckbox(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None)[source]
Bases:
FormElementA standard checkbox form element for boolean input.
This component provides a traditional checkbox UI for users to toggle between True (checked) and False (unchecked) states.
- class FormIconCheckbox(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, on_icon=None, off_icon=None)[source]
Bases:
FormElement- on_icon: IconConfig | None = None
- off_icon: IconConfig | None = None
- set_off_icon(icon)[source]
Sets the icon displayed when the value is False.
- Return type:
FormIconCheckbox
- set_on_icon(icon)[source]
Sets the icon displayed when the value is True.
- Return type:
FormIconCheckbox
- class FormSlider(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None)[source]
Bases:
FormElementA slider (toggle switch) form element for boolean input.
This component presents a sliding toggle UI for users to switch between True and False states, commonly used as an alternative to checkboxes for a more modern, touch-friendly interface.
- class FormDropdown(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, is_searchable=False, is_nullable=False, default_value=None, choices=None, object_reference_display_field=None)[source]
Bases:
FormElementA dropdown (select) input bound to an
OBJECTfield, parameter, or calculation.Displays a list of object references from the bound table. The display label defaults to the table’s key column; override it with
set_display_field(). UseFormElement.set_list_validation()to restrict available choices.- is_searchable
If
True, includes a search box within the dropdown.- Type:
- is_nullable
If
True, allows the value to be cleared to null.- Type:
- default_value
Optional default selection.
- Type:
ObjectValue | None
- choices
Optional model variable supplying an alternative list of choices.
- Type:
ModelVariable | None
- object_reference_display_field
Field to display for each object choice.
- Type:
str | None
- is_searchable: bool = False
- is_nullable: bool = False
- default_value: ObjectValue | None = None
- choices: ModelVariable | None = None
- set_display_field(field)[source]
Sets the field to display for each object choice.
- Return type:
FormDropdown
- set_searchable(searchable)[source]
Sets whether the dropdown is searchable.
- Return type:
FormDropdown
- set_nullable(nullable)[source]
Sets whether the dropdown is nullable.
- Return type:
FormDropdown
- set_choices(choices)[source]
Sets the model variable providing the list of available choices.
- Return type:
FormDropdown
- class FormDatePicker(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, with_selector=False)[source]
Bases:
FormElementA date picker bound to a
DATEfield, parameter, or calculation.Supports range validation via
FormElement.set_range_validation().- with_selector
If
True, displays an inline calendar selector.- Type:
- with_selector: bool = False
- class FormTimePicker(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, time_interval=None)[source]
Bases:
FormElementA time picker bound to a
TIMEfield, parameter, or calculation.Supports range validation via
FormElement.set_range_validation().- time_interval
Minute increment for the time selector (e.g.
15for quarter-hour steps).Noneuses the platform default.- Type:
int | None
- class FormDateTimePicker(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, with_selector=False, time_interval=None)[source]
Bases:
FormElementA combined date and time picker bound to a
DATETIMEfield, parameter, or calculation.Supports range validation via
FormElement.set_range_validation().- with_selector
If
True, displays an inline calendar selector.- Type:
- time_interval
Minute increment for the time portion.
Noneuses the platform default.- Type:
int | None
- with_selector: bool = False
- class FormButton(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, text_value=None, text_color=None, background_color=None, icon_source=None, icon_color=None, on_click=None)[source]
Bases:
FormElementA clickable button that triggers a
ModelEvent.- text_value
Label displayed on the button.
- Type:
str | None
- text_color
CSS-compatible text colour.
- Type:
str | None
- background_color
CSS-compatible background colour.
- Type:
str | None
- icon_source
DaitumIcon identifier (e.g.
"fa.SAVE").- Type:
str | None
- icon_color
CSS-compatible icon colour.
- Type:
str | None
- on_click
Event executed when the button is clicked.
- Type:
ModelEvent | None
- on_click: ModelEvent | None = None
- set_horizontal_alignment(alignment)[source]
Sets the horizontal alignment of the button.
- Return type:
FormButton
- set_size(size)[source]
Sets the visual size of the button.
- Return type:
FormButton
- set_text_color(color)[source]
Sets the text colour of the button.
- Return type:
FormButton
- set_background_color(color)[source]
Sets the background colour of the button.
- Return type:
FormButton
- set_icon_source(icon_source)[source]
Sets the icon source for the button.
- Return type:
FormButton
- set_icon_color(color)[source]
Sets the icon colour for the button.
- Return type:
FormButton
- class FormReviewRating(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, fill_icon=None, empty_icon=None, fill_color=None)[source]
Bases:
FormElementA star (or custom icon) rating input bound to a numeric field, parameter, or calculation.
FormSize.FIT_WIDTHis not supported for this element.- fill_icon
Icon displayed for selected (filled) rating values.
- Type:
IconConfig | None
- empty_icon
Icon displayed for unselected (empty) rating values.
- Type:
IconConfig | None
- fill_color
CSS-compatible colour override for filled icons.
- Type:
str | None
- fill_icon: IconConfig | None = None
- empty_icon: IconConfig | None = None
- set_fill_icon(icon)[source]
Sets the icon used for filled (selected) rating values.
- Return type:
FormReviewRating
- set_empty_icon(icon)[source]
Sets the icon used for empty (unselected) rating values.
- Return type:
FormReviewRating
- set_fill_color(color)[source]
Sets the colour override for filled rating icons.
- Return type:
FormReviewRating
- class FormColourPickerInput(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, swatch_colours=None, allow_custom=None)[source]
Bases:
FormElementColour picker bound to a string field (typically a hex colour).
Optional
swatch_coloursrestricts the palette; when omitted, the UI may use its default theme palette.allow_customenables free-form hex entry when supported.- set_swatch_colours(colours)[source]
Sets the palette of swatch colours available in the colour picker.
- Return type:
FormColourPickerInput
- set_allow_custom(allow)[source]
Sets whether free-form hex colour entry is allowed.
- Return type:
FormColourPickerInput
- class FormIconPicker(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, icon_set=FormIconSet.ALL, defaults=None, preview_color=None)[source]
Bases:
FormElementIcon picker bound to a string field (icon identifier, e.g. dot-path).
icon_setselects which icon catalogue to show. Optionaldefaultslists icon ids shown first;preview_colorsets icon tint in the dropdown.- icon_set: FormIconSet = 'ALL'
- set_defaults(defaults)[source]
Sets the list of icon IDs displayed first in the picker.
- Return type:
FormIconPicker
- set_preview_color(color)[source]
Sets the CSS colour used to tint icons in the picker dropdown.
- Return type:
FormIconPicker
- set_icon_set(icon_set)[source]
Sets the icon catalogue to display in the picker.
- Return type:
FormIconPicker
- class FormLink(data_source_id=None, data_source_object_field_reference=None, row_start=0, column_start=0, row_span=1, column_span=1, horizontal_alignment=HorizontalAlignment.LEFT, size=None, default_value_reference=None, data_validation_rule=None, tooltip_field=None, display_format=None, text_value='Open Model', destination=None)[source]
Bases:
FormElementA form element that renders a hyperlink to an external destination.
Use
FormView.add_model_editor_link()to create and add this element; do not instantiate it directly.- text_value
The visible label of the link. Defaults to
"Open Model".- Type:
- destination
The navigation target. Concrete subclasses of
LinkDestinationspecify where the link points (e.g.ModelEditorLinkDestination).- Type:
LinkDestination | None
- text_value: str = 'Open Model'
- destination: LinkDestination | None = None