Skip to main content
Version: V3 (Ignition 8.3)

tamaki.mes.utils.enumListToDropdown

Description

Converts a list of Java enums into the {'value', 'label'} format used by Perspective dropdown components. For each enum, the option's value is enum.name() and the label is enum.toString().

Syntax

tamaki.mes.utils.enumListToDropdown(el)

Parameters

ParameterTypeNullableDescription
elListFalseThe list of Java enums to format.

Returns

A List of {'value', 'label'} dictionaries.

Code Examples

# In a binding script transform: turn a list of Java enums into dropdown options
return tamaki.mes.utils.enumListToDropdown(value) if value is not None else []