@acorex/cdk 20.2.31 → 20.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2087,6 +2087,19 @@ class MXSelectionValueComponent extends MXValueComponent {
2087
2087
  // For string values, we need to normalize with findByKey=true to trigger async loading
2088
2088
  const isStringValue = typeof item === 'string';
2089
2089
  const normalizedItem = this.normalizeItem(item, isStringValue);
2090
+ // Try template formatting FIRST before checking cached textField
2091
+ if (this.textTemplate) {
2092
+ const formattedTemplate = this.formatService.format(this.textTemplate, 'string', normalizedItem);
2093
+ if (formattedTemplate !== this.textTemplate) {
2094
+ const result = formattedTemplate;
2095
+ // Cache the timestamp and result for debouncing in the cache
2096
+ if (normalizedItem) {
2097
+ normalizedItem['_lastDisplayTextCall'] = now;
2098
+ normalizedItem['_lastDisplayTextResult'] = result;
2099
+ }
2100
+ return result;
2101
+ }
2102
+ }
2090
2103
  // Check if this item is already in the cache with proper text
2091
2104
  const itemValue = get(normalizedItem, this.valueField);
2092
2105
  if (itemValue != null && itemValue !== '') {
@@ -2106,19 +2119,6 @@ class MXSelectionValueComponent extends MXValueComponent {
2106
2119
  }
2107
2120
  }
2108
2121
  }
2109
- // Try template formatting first
2110
- if (this.textTemplate) {
2111
- const formattedTemplate = this.formatService.format(this.textTemplate, 'string', normalizedItem);
2112
- if (formattedTemplate !== this.textTemplate) {
2113
- const result = formattedTemplate;
2114
- // Cache the timestamp and result for debouncing in the cache
2115
- if (normalizedItem) {
2116
- normalizedItem['_lastDisplayTextCall'] = now;
2117
- normalizedItem['_lastDisplayTextResult'] = result;
2118
- }
2119
- return result;
2120
- }
2121
- }
2122
2122
  // Use text field or fallback to value field
2123
2123
  const textValue = get(normalizedItem, this.textField);
2124
2124
  if (textValue != null && textValue !== '') {