admin icon indicating copy to clipboard operation
admin copied to clipboard

How to display validation errors for embedded relations?

Open denisvmedia opened this issue 4 years ago • 0 comments

#249 is closed with the words that Hydra documentation could not be used. So, in my case I have this:

        <EditGuesser onSuccess={ onSuccess } {...props}>
            <InputGuesser source="domain"/>
            <ArrayInput source="configs"> // instead of InputGuesser, which doesn't detect as expected
                <SimpleFormIterator>
                    <TextInput label="setting" source="name"/> // instead of InputGuesser
                    <TextInput label="value" source="data"/> // instead of InputGuesser
                </SimpleFormIterator>
            </ArrayInput>
        </EditGuesser>

It renders this way:

image

And all works fine until I try to submit the data that is invalid. Here is the response:

image

The problem is that the errors do not get attached to the inputs. In fact no errors are displayed apart The form is not valid. Please check for errors. and then for some reason Server communication error. And those are displayed just as a flash message. How can I display the validation errors for configs[*].name and configs[*].data fields?

denisvmedia avatar Jun 29 '21 06:06 denisvmedia