1- import {
2- DynamicValue ,
3- EditableValue ,
4- ListAttributeValue ,
5- ListExpressionValue ,
6- ListWidgetValue ,
7- ObjectItem
8- } from "mendix" ;
1+ import { DynamicValue , ListAttributeValue , ListExpressionValue , ListWidgetValue , ObjectItem } from "mendix" ;
92import { ReactNode , createElement } from "react" ;
103import { OptionsSourceAssociationCustomContentTypeEnum } from "../../../typings/ComboboxProps" ;
114import { CaptionPlacement , CaptionsProvider } from "../types" ;
@@ -22,11 +15,10 @@ interface Props {
2215
2316export class DatabaseCaptionsProvider implements CaptionsProvider {
2417 private unavailableCaption = "<...>" ;
25- private formatter ?: ListExpressionValue < string > | ListAttributeValue < string > ;
18+ formatter ?: ListExpressionValue < string > | ListAttributeValue < string > ;
2619 protected customContent ?: ListWidgetValue ;
2720 protected customContentType : OptionsSourceAssociationCustomContentTypeEnum = "no" ;
2821 attribute ?: ListAttributeValue < string | Big > ;
29- value ?: DynamicValue < string > | EditableValue < string > ;
3022 emptyCaption = "" ;
3123 overrideCaption : string | null | undefined = undefined ;
3224
@@ -63,12 +55,12 @@ export class DatabaseCaptionsProvider implements CaptionsProvider {
6355 if ( ! item ) {
6456 return this . unavailableCaption ;
6557 }
66- this . value = this . formatter ?. get ( item ) ;
67- if ( this . value ? .status === "unavailable" ) {
58+ const captionValue = this . formatter ?. get ( item ) ;
59+ if ( ! captionValue || captionValue . status === "unavailable" ) {
6860 return this . unavailableCaption ;
6961 }
7062
71- return this . value ?. value ?? "" ;
63+ return captionValue ?. value ?? "" ;
7264 }
7365
7466 getCustomContent ( value : string | null ) : ReactNode | null {
0 commit comments