So this is the scenario (snippet)
We have a schema
"Parent": {
"type": "array",
"title": "Parent title",
"options": {
"sortable": true
},
"items": {
"type": "object",
"properties": {
"document": {
"type": "string",
"description": "description",
"title": "document. title",
"oneOf": [
{
"const": "FIRST",
"title": "First item"
},
{
"const": "SECOND",
"title": "second item"
}
]
},
"anotherDocument": {
"type": "string",
"description": "description",
"title": "another title",
"oneOf": [
{
"const": "THIRD",
"title": "third title"
},
{
"const": "FOURTH",
"title": "fourth title"
}
]
}
}
}
}
A uischema
{
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/Parent",
"options": {
"detail": {
"type": "HorizontalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/document"
},
{
"type": "Control",
"scope": "#/properties/antherDocument"
}
]
}
}
}
]
}
(I created a snippet of the schema and uischema, any scope or names that seem incorrect are probably typos in making it a generic example).
With our system setup, this is then run through our renderer tester, and for the first level, we load a so called ‘Array List’ renderer (which is customized), but basically, renders rows (and there are options to sort). The children are then rendererd, one by one, through a default <dispatch-renderer>
which decides on what renderer to use. Then for every step, it will also apply the ControlWrapper.
This is where we run into a ‘problem’.
What we want, is to render the label as you would see with a table head. (this works, not that hard, loop in the parent through the control.schema.properties
).
But now, these children within the rows, they have their labels rendered per element. And, basically, we want to pass a boolean value to the Control Wrapper (or an options object), where we can do that.
But, and yes we might miss things here, it seems that in the dispatch renderer, any customizations are not taking into account, tried to update the ‘appliedOptions’, tried using a config
prop on the DispatchRenderer (which is read). But can’t seem to get the right value on the right level.
Other approaches i have thought of (and maybe discarded).
- Just use CSS to hide the labels of the children → yes! would be so easy! might just do that eventually
- create a custom DispatchRenderer.vue → done that to test out a few things, seems like it would be an option, but rather stay clear from that.
- some convoluted way of using inject and checking parent / child relationships
- add it to the uischema → we have all the different possible scenarios of forms and (ui)schemas, where people creating these need not to think about the visual end result.