DropdownOption

data class DropdownOption<T>(val value: T, val displayText: String, val payload: Any? = null)

A single option of a dropdown list.

Holds the actual value together with the text shown to the user, keeping business logic (the value) apart from presentation (the text).

Type Parameters

T

type of the value held by the option

Constructors

Link copied to clipboard
constructor(value: T, displayText: String, payload: Any? = null)

Properties

Link copied to clipboard

text shown to the user in the interface

Link copied to clipboard
val payload: Any?

Additional data that came with the option (e.g. the whole database row). On selection it goes to ActionContext.payload, so an action can fill other controls from it. It is absent when the form loads - the value then comes from the saved record, not from the menu.

Link copied to clipboard
val value: T

the option's actual value, used in application logic