Fix autocomplete in multiplicity items by using parent field id.

This commit is contained in:
Konstantinos Triantafyllou 2022-07-11 16:34:06 +03:00
parent e329ef763a
commit 989f07787c
1 changed files with 6 additions and 2 deletions

View File

@ -379,8 +379,12 @@ export class FormFieldComponent extends BaseComponent implements OnInit {
searchFromAutocomplete(query: string) {
const autocompleteRequestItem: RequestItem<DatasetExternalAutocompleteCriteria> = new RequestItem();
autocompleteRequestItem.criteria = new DatasetExternalAutocompleteCriteria();
let parseIdArray: string[] = this.form.get('id').value.split('_');
if(parseIdArray.length > 1) {
autocompleteRequestItem.criteria.fieldID = parseIdArray[parseIdArray.length - 1];
} else {
autocompleteRequestItem.criteria.fieldID = this.form.get('id').value;
}
if (typeof this.datasetProfileId === 'string') {
autocompleteRequestItem.criteria.profileID = this.datasetProfileId;
} else if (this.datasetProfileId != null) {