Greetings,
The FlexRepeater component has a feature where new instances added to the “instances“ array have default properties, as shown below.

I’m having trouble mimicking this functionality. I haven’t found an example in the json schemas in the example projects or in other forum posts.
Is it possible to learn this power? If so, what would the schema look like?
bmusson
2
You’re looking for the items
property; this will specify the schema of your array items.
Here’s my flex-repeater for reference:
2 Likes
Thanks! That was exactly what I needed.
For future reference, should I or anyone else be searching the forums for this topic, the following is a simple implementation and its result.
I did have to do a clean build for it to take effect.
{
"type": "object",
"required": [
"schema"
],
"$defs": {
"recipe_schema_item": {
"type": "object",
"properties": {
"colType": {
"type": "string",
"enum": [
"string",
"setpoint",
"control word",
"boolean"
],
"description": "column type within the recipe schema",
"default": "string"
}
}
}
},
"properties": {
"schema": {
"type": "array",
"description": "names, setpoints, control words, and booleans per step",
"default": [],
"items": {
"$ref": "#/$defs/recipe_schema_item"
}
},
"style": {
"$ref": "urn:ignition-schema:schemas/style-properties.schema.json",
"default": {
"classes": ""
}
}
}
}
2 Likes