1. Domino UI
  2. Data
  3. Data select Pro
Top Examples Docs

Data select

Single-selection form control built on top of the package virtualized list infrastructure.

DataSelect is intended for huge option sets where eagerly rendering every option would be expensive. It delegates option presentation to a virtualized DataList.

The selected option is tracked as a VirtualItem, and its rendered field value can be customized through DataSelectItemValueMapper and DataOptionMeta.

V

the value type represented by each option

Abstract data select

Base form element for select components backed by a virtualized DataList.

AbstractDataSelect keeps selection controls responsive for huge option sets by delegating option rendering to the moving-window infrastructure in this package.

It owns the text input, placeholder, type-to-select behavior, option search, selection helpers, and missing-option hooks that concrete controls such as DataSelect build on.

T

the value type represented by the select

I

the rendered data list item type used for options

C

the concrete select subtype

Backed by data list

Virtualized list component for huge data sets.

DataList renders only the visible slice of its backing collection while the full record set remains searchable, selectable, and incrementally mutable.

It works with rendered rows such as DataListItem and CheckableDataListItem, wraps each record as a VirtualItem, and delegates window management to ScrollingWindowList and VirtualScrollPanel.

V

the record type represented by the list

I

the rendered row type used for visible items

Rendered data list item

Default rendered row used by DataList.

DataListItem builds on AbstractDataListItem by rendering a simple text span for the record and exposing hooks for custom clickable behavior.

V

the value type represented by the row

Virtual item

Selection-aware wrapper around a record in a virtualized data set.

Each VirtualItem lazily owns the rendered window item for the current viewport while keeping selection state, metadata, and key resolution attached to the underlying record.

This lets DataList and DataSelect track selection even when a row is currently outside the rendered window.

T

the wrapped record type

I

the rendered window item type

Selected value mapper

Strategy interface for rendering the selected DataListItem value inside an AbstractDataSelect field.

Implementations let a closed select render richer content than plain text by converting the selected row into a DOM node.

T

the value type represented by the selected item

Selected value metadata

Metadata holder used to associate rendered content with a selected option in a virtualized data component.

DataOptionMeta is used by DataSelect to keep the selected-value node attached to the active option and to remove that node cleanly when selection changes.

Examples

API Docs: DataSelect

Static methods

public static DataSelect<V> create(VirtualScrollItemMapper<V, DataListItem<V>> mapper, KeyProvider<V> keyProvider)
Creates a single-selection data select without a label.

mapper

maps option records into rendered data list rows

keyProvider

resolves stable keys for the option records

V

the option value type

public static DataSelect<V> create(String label, VirtualScrollItemMapper<V, DataListItem<V>> mapper, KeyProvider<V> keyProvider)
Creates a labeled single-selection data select.

label

the form label to apply to the select

mapper

maps option records into rendered data list rows

keyProvider

resolves stable keys for the option records

V

the option value type

Public methods

public DataSelect<V> withOption(VirtualItem<V, DataListItem<V>> option, boolean silent)
Applies a selected option, updates the field display, and optionally suppresses change listeners.

option

the virtual option to mark as selected

silent

true to avoid notifying change listeners

public V getValue()
Returns the record for the currently selected option.

Returns:

the selected value, or null when nothing is selected

public VirtualItem<V, DataListItem<V>> getSelectedOption()
Returns the currently selected virtual option.

Returns:

the selected option wrapper, or null if no option is selected

public DataSelect<V> setAutoFocus(boolean autoFocus)
Controls whether the select should focus itself after option selection.

autoFocus

true to keep focus on the select after updates

public boolean isAutoFocus()
Indicates whether the select is configured to autofocus after updates.

Returns:

true when autofocus is enabled

API Docs: AbstractDataSelect

Constructors

public void AbstractDataSelect(VirtualScrollItemMapper<T, I> mapper, KeyProvider<T> keyProvider)
Creates the form field, hidden input, type-ahead input, and virtualized options menu used by the select.

mapper

maps each option record into its rendered list row

keyProvider

resolves stable keys for the option records

Public methods

public C setPlaceholder(String placeholder)
Sets the placeholder text shown when the select has no value.

placeholder

the placeholder text to display

public C setTypeToSelect(boolean typeToSelect)
Enables or disables the type-ahead selection input.

typeToSelect

true to allow typing directly into the select for quick matching

public C withValue(T value, boolean silent)
Sets the selected value and optionally suppresses change listeners.

value

the value to select

silent

true to avoid notifying change listeners

public DataList<T, I> getOptionsMenu()
Exposes the underlying virtualized options list used by the select.

Returns:

the backing DataList instance

public C selectByValue(T value, boolean silent)
Finds an option by its record value and selects it.

value

the option value to select

silent

true to avoid notifying change listeners

public C setSearchable(DataFilter<T> dataFilter)
Turns on option searching by delegating token matching to the provided data filter.

dataFilter

the search predicate applied to each option record

public C withOptionsMenu(ChildHandler<C, DataList<T, I>> handler)
Applies custom configuration directly to the backing options menu.

handler

receives the select instance and its options menu

public C setOptions(Collection<T> records)
Replaces the available option records shown by the select.

records

the new option records

API Docs: DataList

Static methods

public static DataList<V, I> create(VirtualScrollItemMapper<V, I> mapper, KeyProvider<V> keyProvider)
Creates a virtualized data list backed by the supplied row mapper and key provider.

mapper

maps each record into its rendered list item

keyProvider

resolves stable keys for record lookup and selection

V

the record type

I

the rendered row type



Returns:

a new DataList instance

Public methods

public DataList<V, I> setItems(List<V> items)
Replaces the backing records for the list and rebuilds the virtual window from the new data set.

items

the records to expose through the list



Returns:

this DataList instance

public DataList<V, I> setSearchable(DataFilter<V> dataFilter)
Enables search by attaching a filter that decides whether each record matches the current token.

dataFilter

the search predicate to apply for each record, or null to disable searching



Returns:

this DataList instance

public List<I> getWindowItems()
Returns the currently rendered rows in the visible window rather than the full backing collection.

Returns:

the list items currently materialized in the viewport

public Optional<I> findOptionStarsWith(String token)
Searches the rendered window for the first row whose text starts with the supplied token.

token

the prefix to match against visible rows



Returns:

the first matching rendered row, if one is currently in the window

public DataList<V, I> selectAll(boolean silent)
Marks every virtual item in the list as selected.

silent

true to suppress selection listener callbacks while selecting



Returns:

this DataList instance

public DataList<V, I> deselectAll(boolean silent)
Clears the selection state from every virtual item in the list.

silent

true to suppress deselection listener callbacks while clearing



Returns:

this DataList instance

public VirtualScrollListVirtualScroll<V, I> getVirtualScrollPanel()
Exposes the virtual scroll container that owns window sizing, scroll synchronization, and row recycling.

Returns:

the virtual scroll panel used by this list

API Docs: DataListItem

Constructors

public void DataListItem(String text, V value)
Creates a rendered row with the supplied text content and backing record value.

text

the text displayed inside the row body

value

the record represented by the row

Static methods

public static DataListItem<V> create(String text, V value)
Convenience factory for creating a text-based data list row.

text

the text displayed inside the row body

value

the record represented by the row

V

the value type represented by the row



Returns:

a new DataListItem instance

Public methods

public DataListItem<V> withClickableElement(ChildHandler<DataListItem<V>, AnchorElement> handler)
Allows direct customization of the anchor element that acts as the row's primary interactive surface.

handler

receives the row and its clickable anchor element



Returns:

the current DataListItem instance

public SpanElement getTextElement()
Returns the span that displays the row text content.

Returns:

the text element for this row, or null when no text was supplied

API Docs: VirtualItem

Constructors

public void VirtualItem(T record, VirtualScrollItemMapper<T, I> mapper, KeyProvider<T> keyProvider)
Creates a virtual wrapper for a record and stores the mapper and key provider needed to materialize it on demand.

record

the underlying record

mapper

creates the rendered window item when needed

keyProvider

resolves stable keys for the wrapped record

Public methods

public VirtualItem<T, I> select(boolean silent)
Marks the wrapped record as selected and updates the rendered row if that row is currently materialized.

silent

true to suppress selection listeners

public VirtualItem<T, I> deselect(boolean silent)
Clears selection state for the wrapped record and updates the rendered row if present.

silent

true to suppress deselection listeners

public I windowItem()
Materializes the rendered window item the first time it is needed and binds it back to this virtual item.

Returns:

the rendered window item for the current record

public T getRecord()
Returns the wrapped backing record.

Returns:

the record associated with this virtual item

public VirtualItem<T, I> setSelectable(boolean selectable)
Controls whether the wrapped record can enter the selected state.

selectable

true when the record should be selectable

public String getKey()
Returns the stable key resolved by the configured key provider.

Returns:

the key that identifies this virtual item

API Docs: DataSelectItemValueMapper

Default methods

public Node toElement(DataListItem<T> item)
Creates the DOM node that should be displayed inside the closed select for the selected option.

item

the selected rendered option row

API Docs: DataOptionMeta

Static methods

public static DataOptionMeta of(Node component)
Creates metadata for a rendered node that should represent the selected option inside the field.

component

the rendered node to attach to the option

public static Optional<DataOptionMeta> get(HasMeta<?> component)
Looks up previously attached option metadata from a component that supports meta objects.

component

the component to inspect for option metadata

public static void clear(HasMeta<?> component)
Removes the rendered selected-value node from the DOM and clears the attached metadata record.

component

the component whose selected-value metadata should be removed

Public methods

public Node getComponent()
Returns the rendered node associated with this metadata entry.

Returns:

the selected-value node

public String getKey()
Returns the metadata storage key used for selected option content.

Returns:

the metadata key for option content

We are a group of passionate people who love what we do

Donate & Support Us