CollectionObject
| 📊 Overview: 3 Properties | 1 Constructor | 10 Functions |
📝 Description
Creates a collection wrapper for UI dropdowns with optional placeholder text
🕐 Last updated: 2025-12-10T11:45:22.462Z
📑 Table of Contents
- 📋 Properties (3)
- 🏗️ Constructor (2 params)
- ⚙️ Functions
- Regular Functions
- CollectionObject →
$CollectionObject : Object - SetIndex (1 param)
- GetIndex →
$index : Integer - SetPlaceholder (1 param)
- AppendValue (1 param)
- AppendValueWithPrimaryKey (2 params)
- AppendValueWithEntity (2 params)
- GetCurrentValue →
$currentValue : Variant - GetCurrentPrimaryKey →
$currentPrimaryKey : Integer - GetCurrentEntity →
$currentEntity : 4D.Entity
- CollectionObject →
- Regular Functions
Properties
| Property | Type | Default | Description |
|---|---|---|---|
_CollectionObject | Object | - | Internal object storing collection values, current index, and selected value |
_primaryKeys | Collection | [] | Collection of primary keys corresponding to each value |
_entities | Collection | [] | Collection of entity objects corresponding to each value |
Constructor
constructor
[🏗️ constructor]
Class constructor($valuesCollection : Collection; $placeHolderText : Text)
Creates a collection wrapper for UI dropdowns with optional placeholder text
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$valuesCollection | Collection | - | - |
$placeHolderText | Text | - | - |
Functions
Regular Functions
CollectionObject
Function CollectionObject -> $CollectionObject : Object
Returns the internal collection object containing values, index, and currentValue
Returns: Object
SetIndex
Function SetIndex($index : Integer)
Sets the current selected index in the collection
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$index | Integer | - | - |
GetIndex
Function GetIndex -> $index : Integer
Returns the current selected index in the collection
Returns: Integer
SetPlaceholder
Function SetPlaceholder($placeHolderText : Text)
Resets selection to placeholder state with specified text
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$placeHolderText | Text | - | - |
AppendValue
Function AppendValue($value : Variant)
Adds a new value to the collection without primary key or entity
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$value | Variant | - | - |
AppendValueWithPrimaryKey
Function AppendValueWithPrimaryKey($value : Variant; $primaryKey : Integer)
Adds a new value to the collection with associated primary key
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$value | Variant | - | - |
$primaryKey | Integer | - | - |
AppendValueWithEntity
Function AppendValueWithEntity($value : Variant; $entity : 4D.Entity)
Adds a new value to the collection with associated entity reference
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$value | Variant | - | - |
$entity | 4D.Entity | - | - |
GetCurrentValue
Function GetCurrentValue -> $currentValue : Variant
Returns the currently selected value from the collection
Returns: Variant
GetCurrentPrimaryKey
Function GetCurrentPrimaryKey -> $currentPrimaryKey : Integer
Returns the primary key associated with the currently selected item
Returns: Integer
GetCurrentEntity
Function GetCurrentEntity -> $currentEntity : 4D.Entity
Returns the entity associated with the currently selected item
Returns: 4D.Entity
Generated from CollectionObject.4dm