Hi Stefan,
thank you for your fast reply! Until now, I created custom renderers for each component that I use, but I have no clue where I could modify the handleChange prop⌠Here is some example code how my custom renderers are working:
<JsonForms
schema={schema}
uischema={uischema}
data={data}
renderers={renderers}
cells={RNCells}
validationMode={validationMode}
onChange={({ _errors, data }) => modifiedHandleChange(_errors, data)}
/>
</View>
// here some imports are done
const RendererInputField = ({
schema, data, handleChange, uischema, path,
}) => {
return (
<InputField
data={data}
onChange={(ev) => handleChange(path, ev)}
/>
);
};
export const inputFieldTester = rankWith(
100,
optionIs('format', 'customInputField'),
);
export default withJsonFormsControlProps(RendererInputField);
At which point should I modify the handleChange prop?
To answer your last question: I need to collect data about the exact time when specific data was recorded, so this is no data which would be displayed in the form, but is connected to data which is affected by the user input.
When I am logging the path and ev variable inside the renderer it gives me exactly the data I need, but this data is not the same inside the handleChange method that I am calling from the JsonForms-Tag. I tried to change the JsonForms to this:
<JsonForms
schema={schema}
uischema={uischema}
data={data}
renderers={renderers}
cells={RNCells}
validationMode={validationMode}
onChange={({ path, ev }) => modifiedHandleChange(path, ev)}
/>
const modifiedHandleChange = (path, ev) => {
// implementation of different cases for different changes of data
// here, path and ev are undefined
}
But path and ev are undefined in this case.