Autocomplete show the id if the service doesn't return any results

This commit is contained in:
argirok 2022-06-09 17:54:05 +03:00
parent 512d1401df
commit f8fb76563e
1 changed files with 8 additions and 1 deletions

View File

@ -107,6 +107,7 @@ export class StaticAutoCompleteComponent implements OnChanges{
this.handleError("Error getting vocabulary with id: "+this.vocabularyId+" for "+this.entityName);
this.warningMessage = "An Error occurred..."
this.showLoading = false;
this.afterListFetchedActions();
}
}
);
@ -122,6 +123,7 @@ export class StaticAutoCompleteComponent implements OnChanges{
this.handleError("Error getting results for refine field: "+this.fieldName+" for "+this.entityName, err);
this.warningMessage = "An Error occured..."
this.showLoading = false;
this.afterListFetchedActions();
}
);
}else{
@ -276,7 +278,12 @@ export class StaticAutoCompleteComponent implements OnChanges{
return (str.length > size)?str.substr(0,size)+'...':str;
}
private getSelectedNameFromGivenId(){
if(this.list == null ){
if(this.list == null || this.list.length == 0 ){
this.selected.push({label: this.selectedValue, value: this.selectedValue});
this.showInput = false;
this.updateValueLabel.emit({
value:this.showItem(this.selected[0])
});
return;
}
this.showInput = true;