How to make selection checkboxes selected by default?
According to the docs, the optionsConfig can be used for this purpose:
> The config of the options components. For selections of type "checkbox" and "radio" optionsConfig will be passed to every single CheckBox or Radio. For "select" and "combobox" optionsConfig will be passed to the underlaying ComboBox.
For checkbox, here's what the docs say about checked:
> true if the checkbox should render initially checked (defaults to false)
So for my dialog, I have configured a selection widget like this:
<test jcr:primaryType="cq:Widget"
options="/apps/.../options.json"
xtype="selection"
type="checkbox">
<optionsConfig jcr:primaryType="nt:unstructured" checked="{Boolean}true"/>
</test>
options.json:
[
{
"text": "Option 1",
"value": "option1"
},
{
"text": "Option 2",
"value": "option2"
}
]
However this is not causing all the checkboxes to be checked initially.
What is the proper, non-hacky way of doing this?
Thanks in advance.