SelectListView

ceramic.Entityceramic.Visualceramic.Quadceramic.Layerceramic.Viewelements.SelectListView (Class)

A scrollable list view for displaying selectable items in dropdown controls.

SelectListView provides a virtualized list interface for selecting from a collection of string options. It supports highlighting the current selection, null value handling, and automatic scrolling to selected items. The view uses a CollectionView for efficient rendering of large lists.

Key features:

  • Virtualized scrolling for performance with large lists
  • Current selection highlighting
  • Support for null values with custom display text
  • Click and touch interaction
  • Automatic scrolling to selected items
  • Customizable cell styling through themes

Usage example:

var listView = new SelectListView();
listView.list = ['Item 1', 'Item 2', 'Item 3'];
listView.nullValueText = 'None';
listView.value = 'Item 2';
listView.size(200, 150);
listView.onValueChange(this, (value, prev) -> {
    trace('Selected: ' + value);
});
add(listView);

Static Members

elements
ITEM_HEIGHT: Int

Height of each item in the list in pixels

Instance Members

elements
observedDirty: Bool

Default is false, automatically set to true when any of this instance's observable variables has changed.


elements
theme: Theme

Custom theme override for this list view. If null, uses the global context theme


elements
autoScrollToValue: Bool

Whether to automatically scroll to the selected value when it changes


elements
value: String

The currently selected value. Can be null if no value is selected


Array of string options to display in the list


elements
nullValueText: String

Text to display for the null/empty value option. If null, no null option is shown


elements
invalidateTheme(): Void

elements
invalidateValue(): Void

elements
invalidateList(): Void

elements
invalidateNullValueText(): Void

elements
scrollToValue(position: ceramic.CollectionViewItemPosition): Void

Scrolls the list to show the currently selected value.

Name Type Description
position ceramic.CollectionViewItemPosition How to position the item (START, CENTER, END, ENSURE_VISIBLE)

elements
collectionViewSize(collectionView: ceramic.CollectionView): Int

Returns the total number of items in the list.

Includes an extra item if nullValueText is set to represent the null option.

Name Type Description
collectionView ceramic.CollectionView The collection view requesting the size
Returns Description
Int Total number of items including null option if applicable

elements
collectionViewItemFrameAtIndex(collectionView: ceramic.CollectionView, itemIndex: Int, frame: ceramic.CollectionViewItemFrame): Void

Provides the frame (size and position) for an item at the given index.

All items have the same height (ITEM_HEIGHT) and fill the collection view width.

Name Type Description
collectionView ceramic.CollectionView The collection view requesting the frame
itemIndex Int Index of the item
frame ceramic.CollectionViewItemFrame Frame object to populate with size information

elements
collectionViewReleaseItemAtIndex(collectionView: ceramic.CollectionView, itemIndex: Int, view: ceramic.View): Bool

Called when a view is no longer needed at the given index.

Allows cleanup before view reuse. For SelectListView, cells can always be reused.

Name Type Description
collectionView ceramic.CollectionView The collection view releasing the item
itemIndex Int Index of the item being released
view ceramic.View The view being released
Returns Description
Bool true if the view can be reused, false otherwise

elements
collectionViewItemAtIndex(collectionView: ceramic.CollectionView, itemIndex: Int, reusableView: ceramic.View): ceramic.View

Creates or reuses a view for the item at the given index.

Creates CellView instances to display list items. Reuses existing views when possible for performance. Binds cell data and interaction handlers.

Name Type Description
collectionView ceramic.CollectionView The collection view requesting the item
itemIndex Int Index of the item
reusableView ceramic.View Existing view that can be recycled, if available
Returns Description
ceramic.View The view to display for this item

elements
new(): Void

Creates a new SelectListView.

Sets up the collection view for virtualized scrolling, configures data binding, and initializes automatic scrolling behavior.

Private Members

elements
unobservedTheme: Theme

elements
unobservedValue: String

elements
unobservedList: ceramic.ReadOnlyArray<String>

elements
unobservedNullValueText: String

elements
collectionView: CellCollectionView

The collection view that handles virtualized scrolling and cell management


elements
emitObservedDirty(instance: SelectListView, fromSerializedField: Bool): Void

Event when any observable value as changed on this instance.

Name Type
instance SelectListView
fromSerializedField Bool

elements
emitThemeChange(current: Theme, previous: Theme): Void

Event when theme field changes.

Name Type
current Theme
previous Theme

elements
emitValueClick(value: String): Void

Event emitted when a value is clicked/selected

Name Type
value String

elements
emitValueChange(current: String, previous: String): Void

Event when value field changes.

Name Type
current String
previous String

elements
emitListChange(current: ceramic.ReadOnlyArray<String>, previous: ceramic.ReadOnlyArray<String>): Void

Event when list field changes.

Name Type
current ceramic.ReadOnlyArray<String>
previous ceramic.ReadOnlyArray<String>

elements
emitNullValueTextChange(current: String, previous: String): Void

Event when nullValueText field changes.

Name Type
current String
previous String

elements
updateScrollFromValueIfNeeded(): Void

Updates scroll position to show the current value if auto-scrolling is enabled.

This is called automatically when the value changes and autoScrollToValue is true.


elements
layout(): Void

elements
bindCellView(cell: CellView): Void

Binds data and interaction handlers to a cell view.

Sets up automatic updates for cell content, selection state, and theme, and configures click handling for value selection.

Name Type Description
cell CellView The cell view to bind

elements
updateStyle(): Void

Updates the visual style of the list view based on the current theme.

Sets the background color, border appearance, and other visual properties to match the current theme.

Metadata

Name Parameters
:build tracker.macros.ObservableMacro.build()
:autoBuild tracker.macros.ObservableMacro.build()
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()