Hello,
I would like to implement a Complex OneOfRender with the vue framework.
I look at the React Material code fo complex/MaterialOneOfRender.tsx.
- “findUISchemas” in “createCombinatorRenderInfos” generate a default uischema for the properties in my schema (type:Object).
The thing is that I want to use for the object schema properties, uischemas defined in my uischema object.
My Uischema scopes are linked to my schema properties name. The uischemas contains rules to show, hide control depending of “anotherVar”.
Because “findUIschema” generate default uischema, I loose the rule for my uischema.
A solution I tried was:
- After calling “createCombinatorRenderInfos”
- replace the uischemas of for each “oneOfRenderInfos” element (returned by “createCombinatorRenderInfos”) by the one in the uischema object (I flattened the uischema to one array of UISchemaElement and make a find request with a condition of “scopeEndIs”).
Uischema are well updated but the rules are not working (not reactive). “visible” attribute is always false even if the rule is matched.
*Here is an example of the schema and uischema
schema
"myOneOfVar": {
"oneOf": [
{
"type": "object",
"properties": {
"var1": {
"type": "number"
}
},
"required": []
},
{
"type": "object",
"properties": {
"var2": {
"type": "number"
},
"var3": {
"type": "number"
},
"var4": {
"type": "number"
}
},
"required": []
}
]
},
uischema
{
"type": "Control",
"scope": "var1",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/anotherVar",
"schema": {
"const": "inf"
}
}
}
},
{
"type": "Control",
"scope": "var2",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/anotherVar",
"schema": {
"const": "inf"
}
}
}
},