Sorry for the late reply.
This happens very likely because of the implementation of the radio component, which probably expects the value
to be a string. So, when you programmatically set the value
of the component, UI Bakery checks if it can find an option
with that string as value
and sets that radio button active. The value
of the component might be set to the object, but since it couldn’t find any string value matching the object passed in setValue
it doesn’t set any radio button active.
The only solution that comes to mind right now, would be to set the value to a CSV like format.
So instead of
[
{
title: "One",
value: {
title: "One",
uibName: 1,
knackName: 1,
displayName: "One"
}
},
{ ... }
]
set the value to something like
[
{
title: "One",
value: "One;1;1;One"
}
]
This way, when you need the specific props, you can just value.split(";")
.
This can get pretty ugly, though, when setting the value directly like
{{ ui.radio.setValue("One;1;1;One") }}
and also unmanageable when there are many more props than that.
One solution to that might be to have the options in an action, so that when you want to set a value programmatically you can do something like
const options = {{ actions.options.data }};
const desiredOption = options.find(o => o.title === "One");
{{ ui.radio.setValue(desiredOption.value) }};
Hope that works for you. If it doesn’t, just say the word and we might find a different solution that works for you. 