diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts index 3fa89243f9..1ca858cb1b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts @@ -379,7 +379,14 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo }); const modalComp = this.modalRef.componentInstance; - modalComp.query = this.model.value && !this.model.readOnly ? this.model.value.value : ''; + if (hasValue(this.model.value) && !this.model.readOnly) { + if (typeof this.model.value === 'string') { + modalComp.query = this.model.value; + } else if (typeof this.model.value.value === 'string') { + modalComp.query = this.model.value.value; + } + } + if (hasValue(this.model.value)) { this.model.value = ''; this.onChange({ diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts index fa21810ed9..0d5019aaa8 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts @@ -79,7 +79,15 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy */ metadataFields: string; - query: string; + _query: string; + set query(q: string) { + console.log('set query', q); + this._query = q; + }; + + get query(): string { + return this._query; + } /** * A map of subscriptions within this component