Hello,
I’d like to use findUISchema in a custom angular material control to be able to input the rendererProps of the JsonFormsOutle like it’s done in TableRenderer for instance.
The idea is to be able to manage a dictionary. I’d like to be able to add and remove entries (done) but also to edit the value of an entry (problematic).
Here is an example of the JSON Schema:
{
“type”: “object”,
“properties”: {
“someprop”: {
“type”: “object”,
“properties”: {
“dictionary”: {
“type”: “array”,
“title”: “A beautiful dictionary”,
“items”: {
“type”: “object”,
“properties”: {
“key”: {
“type”: “string”,
“minLength”: 1
},
“value”: {
“type”: “string”,
“minLength”: 1
}
},
“required”: [
“key”,
“value”
],
“additionalProperties”: false
},
“minItems”: 1,
“additionalItems”: false
}
},
“additionalProperties”: false
}
}
}
And the UI Schema looks like this:
{
“type”: “Dictionary”,
“scope”: “#/properties/someprop/properties/dictionary”
}
In my renderer, for each item of my data, I try to generate the renderer properties using this snipet:
getRendererProps(index: number): OwnPropsOfRenderer {
const { schema, uischemas, scopedSchema, uischema } = this;
const controlElement = uischema as ControlElement;
const path = Paths.compose(this.propsPath,${index}.value
);
const rendererUischema = findUISchema(
uischemas,
scopedSchema,
uischema.scope,
path,
“Control”,
null,
schema
);
return {
schema,
path,
uischema: rendererUischema,
};
}
I tried many combinaisons for the arguments of findUISchema
but I cannot get it to work…
Could you please explain to me how to use this function, the context and different arguments?