You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want the name to be displayed on the suggestions. So I set a variable:
public labelAttribute = 'name';
on my dataProvider object. Everything work fine!
Of course if I comment the labelAttribute variable I have an error because auto-complete don't know which field to choose to display. So the variable labelAttribute is really used as expected.
But I want to have the field 'company_parent_3_name' saved on the database instead of the 'name' field. 'company_parent_3_name' is the objects primary key. So i set a variable:
public formValueAttribute = 'company_parent_3_name';
on my dataProvider object. The non expected result:
The 'company_parent_3_name' is taken into account as the value of the auto-complete as I wanted but is also used as text displayed in the suggestions list. I don't see 'name' values any more. The variable labelAttribute seems to not be used any more. And to confirme that, I can comment it without generating any error.
Idea of reason:
I haven't spend so much time trying to understand your code but if it can help, here is what I have seen. In both getFormValue and getLabel functions you have the following code:
let attr = this.provider.formValueAttribute == null ?
this.provider.labelAttribute : this.provider.formValueAttribute;
If I understand well, as soon as the variable formValueAttribute is defined the variable labelAttribute is override. Ok for the getFormValue function but it's probably not the appropriate code for the getLabel function...
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered:
I'm submitting a
Description
Version Information
Browser
My problem is the same as bug #64 , I will be more details oriented.
I have an array of objects:
Here is the HTML code:
Here is the dataProvider getResults function:
I want the name to be displayed on the suggestions. So I set a variable:
public labelAttribute = 'name';
on my dataProvider object.
Everything work fine!
Of course if I comment the labelAttribute variable I have an error because auto-complete don't know which field to choose to display. So the variable labelAttribute is really used as expected.
But I want to have the field 'company_parent_3_name' saved on the database instead of the 'name' field. 'company_parent_3_name' is the objects primary key. So i set a variable:
public formValueAttribute = 'company_parent_3_name';
on my dataProvider object.
The non expected result:
The 'company_parent_3_name' is taken into account as the value of the auto-complete as I wanted but is also used as text displayed in the suggestions list. I don't see 'name' values any more. The variable labelAttribute seems to not be used any more. And to confirme that, I can comment it without generating any error.
Idea of reason:
I haven't spend so much time trying to understand your code but if it can help, here is what I have seen. In both getFormValue and getLabel functions you have the following code:
If I understand well, as soon as the variable formValueAttribute is defined the variable labelAttribute is override. Ok for the getFormValue function but it's probably not the appropriate code for the getLabel function...
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered: