Entities autocomplete: show selected value if the service doesn't return
This commit is contained in:
parent
f8fb76563e
commit
de3ae0dcf1
|
@ -5,6 +5,7 @@ import {Observable, Subject} from 'rxjs';
|
|||
import {EntitiesSearchService} from './entitySearch.service';
|
||||
import{EnvProperties} from '../properties/env-properties';
|
||||
import {StringUtils} from "../string-utils.class";
|
||||
import {AutoCompleteValue} from "../../searchPages/searchUtils/searchHelperClasses.class";
|
||||
|
||||
|
||||
//Usage example
|
||||
|
@ -279,6 +280,11 @@ export class EntitiesAutocompleteComponent {
|
|||
err => {
|
||||
//console.log("An error occured"));
|
||||
this.handleError("Error getting results of type: "+this.entityType+" with id: "+this.selectedValue, err);
|
||||
this.selected.push( {label:this.selectedValue, id :this.selectedValue});
|
||||
this.updateValueLabel.emit({
|
||||
value:this.showItem(this.selected[0])
|
||||
});
|
||||
this.showInput = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ export class StaticAutoCompleteComponent implements OnChanges{
|
|||
}
|
||||
private getSelectedNameFromGivenId(){
|
||||
if(this.list == null || this.list.length == 0 ){
|
||||
this.selected.push({label: this.selectedValue, value: this.selectedValue});
|
||||
this.selected.push({label: this.selectedValue, id: this.selectedValue});
|
||||
this.showInput = false;
|
||||
this.updateValueLabel.emit({
|
||||
value:this.showItem(this.selected[0])
|
||||
|
|
Loading…
Reference in New Issue