Add support to specify field other than id for ReferenceInput
Is your feature request related to a problem? Please describe.
When using custom optionValue for SelectInput as shown bellow
<ReferenceInput label="Language code" source="language_code" reference="languages">
<SelectInput optionText="name" optionValue="code" />
</ReferenceInput>
ReferenceInput will use code to make requests to retrieve resource, which is undesired behaviour.
I'm using ReferenceInput inside Filter and I need to provide custom optionValue for filter search, while keeping id for ReferenceInput
Describe the solution you'd like
Add new property on ReferenceInput to support custom identificator
<ReferenceInput optionValue="id">
https://stackoverflow.com/questions/51021661/react-admin-using-field-other-than-id-for-referenceinput
Plus I've some extra weird behaviour, react-admin returns warning like
Warning: Missing translation for key: "https://localhost:8443Èze is not a valid URL."
Where Èze is a resource name, when <SelectInput optionText='name' optionValue='name'/> is used.
P.S. I'm using react-admin via api-platform/admin.
Already answered on the stackoverflow question you linked
That's why it's a feature request ;)
Unless I'm mistaken, to reimplement ReferenceInput and ReferenceInputController with ability to specify field for Reference and field for Filter will require to maintain my own version of this two files inside a project? That's a crazy overhead for so simple use case.
It's a quite a general purpose use-case, I think it should be solved in the core.
Also related: #2022
Is anything happening with this?
I'd love to have this feature too
We're not going to implement it. Do the mapping with your id field in your dataProvider.